The Febrl system is provided with a logging system that can
display and save to a file logging information with different levels
(i.e. different details of output). A project log can be
initialised in a project.py module as shown
in the code example below. It is assumed that the febrl.py
module has been imported using the
from febrl import * command
init_febrl_logger() function is implemented in the
febrl module). A project log should be initialised first
thing in a project module, as shown in Chapter 5.
See the Python standard module logging.py
for more details about the Python logging system.
# ==================================================================== init_febrl_logger(log_file_name = 'example-febrl-project.log', file_level = 'WARNING', console_level = 'INFO', clear_log = False, parallel_output = 'host')
The following arguments need to be given to a project log when it is initialised.
None(the default) no logging information will be saved (but still displayed).
'CRITICAL', with decreasing level of logging information being written (i.e. all log messages are written when the level is set to
'NOTSET', and only critical information is written when set to
'CRITICAL'). A useful amount of information is logged if the level is set to
'WARNING'. A current limitation is that the file log level can only be equal to or higher than the console level. If the console level is higher, then the file level is set to the console level as well by the Python logging system.
file_levelare possible. Useful levels are
False). When set to
True, all information stored in the given log file is deleted first, and a new log is started. Otherwise, logging information is appended to a log file (if it exists, otherwise it is created first).
'host'(the default) in which case only the host process (where Febrl has been started on) is displaying and logging messages, or
'all'in which case all processes are displaying and logging. Note that when run in parallel each process writes it's own log file.