nabu.resources.logger module

class nabu.resources.logger.Logger(loggername, level='DEBUG', logfile='logger.log', console=True)[source]

Bases: object

Configure a Logger object.

Parameters:
  • loggername (str) – Logger name.

  • level (str, optional) – Logging level. Can be “debug”, “info”, “warning”, “error”, “critical”. Default is “debug”.

  • logfile (str, optional) – File where the logs are written. If set to None, the logs are not written in a file. Default is “logger.log”.

  • console (bool, optional) – If set to True, the logs are (also) written in stdout/stderr. Default is True.

info(msg)[source]
debug(msg)[source]
warning(msg)[source]
warn(msg)
error(msg)[source]
fatal(msg)[source]
critical(msg)[source]
nabu.resources.logger.LoggerOrPrint(logger)[source]

Logger that is either a “true” logger object, or a fall-back to “print”.

class nabu.resources.logger.PrinterLogger[source]

Bases: object