Library to provide simple methods to bootstrap logger with default settings.
Library to provide simple methods to bootstrap logger with default settings.
In your main.py module add:
import logging
import loggingbootstrap
loggingbootstrap.create_double_logger("toplevelmodule", logging.INFO, "example.log", logging.DEBUG)
NOTE: This step is only required to do once.
After the previous configuration just use logger like this:
logger = logging.getLogger(name) # this will associate with the top level module
logger.debug("hello world")
Result (example):