mixmo.utils.logger.get_logger

mixmo.utils.logger.get_logger(logger_name, level='SPAM')[source]
Get the logger and:
  • improve logger levels:

    spam, debug, verbose, info, notice, warning, success, error, critical

  • add colors to each levels, and print ms to the time

Use:

As a global variable in each file:

>>>    LOGGER = logger.get_logger('name_of_the_file', level='DEBUG')
   The level allows to reduce the printed messages
Jupyter notebook:

Add argument “isatty=True” to coloredlogs.install() Easier to read with ‘fmt = “%(name)s[%(process)d] %(levelname)s %(message)s”’