mcot.utils.log

Functions

get_level()

Returns the requested log level.

setup_log([filename, replace])

Sets up the logger to log to the given filename.

get_level

mcot.utils.log.get_level()[source]

Returns the requested log level.

0: no logging 1: warning+ 2: info+ 3: debug+ 4: all+

setup_log

mcot.utils.log.setup_log(filename=None, replace=True)[source]

Sets up the logger to log to the given filename.

Sets up logging to:

  • If .log directory exists:

    • ~/.log/python.info (INFO and higher)

    • ~/.log/python.debug (DEBUG and higher)

  • stderr (minimum level is set by MCLOG; default values are DEBUG if submitted, INFO otherwise)

  • filename if provided

Parameters
  • filename – filename used in the logging (default: only set up logging to stdout/stderr and ~/.log directory)

  • replace – if replace is True, replace the existing handlers