\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
check_log¶
View page sourceChecks Logs For Warnings and Errors¶
Prototype¶
# at_cascade.check_log
def check_log(
message_type ,
all_node_database ,
root_database ,
job_table ,
start_job_id = None ,
max_job_depth = None ,
) :
assert type(message_type) == str
assert type(all_node_database) == str
assert type(root_database) == str
if start_job_id == None :
start_job_id = 0
assert max_job_depth == None or type(max_job_depth) == int
# ...
assert type(message_dict) == dict
return message_dict
Purpose¶
Read the logs for a cascade and return all the messages of a certain type. The databases are not modified (are opened in a read only fashion).
message_type¶
is equal to error, warning or at_cascade .
The corresponding messages are returned.
all_node_database¶
specifies the location of the
all_node_db
relative to the current working directory.
This argument can’t be None.
root_database¶
specifies the location of the dismod_at root_database.
job_table¶
This is the job_table that we are checking the log messages in. Only jobs for which prior_only is false are included; i.e., only jobs that correspond to fits.
start_job_id¶
This is the job that the log messages should start at. If this is None, the first job in the job table is the start job. Jobs before this job in the job_table are not included.
max_job_depth¶
This is the number of generations below the start job that are included; see Node Depth Versus Job Depth . If max_job_depth is None, all the jobs below the start job are included. If max_job_depth is zero, only the start job is included.
message_dict¶
For each job_name in the job table that is a key in message_dict. The corresponding value
is a non-empty list of str containing the messages for that job.
If a job_name is not a key is in message_dict,
there were no messages of the specified type for that job.