nabu.resources.logger
source module nabu.resources.logger
Classes
-
Logger — Configure a Logger object.
Functions
-
LoggerOrPrint — Logger that is either a "true" logger object, or a fall-back to "print".
source class Logger(loggername, level='DEBUG', logfile='logger.log', console=True, prefix='')
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.
Methods
source method Logger.set_prefix(prefix)
source method Logger.info(msg)
source method Logger.debug(msg)
source method Logger.warning(msg)
source method Logger.error(msg)
source method Logger.fatal(msg)
source method Logger.critical(msg)
source LoggerOrPrint(logger)
Logger that is either a "true" logger object, or a fall-back to "print".
source class PrinterLogger(prefix='')
Methods
source method PrinterLogger.set_prefix(prefix)