Logger should not be changed at module level
Most modules seem to contain the following lines (at the module level):
logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler())
The logger should not be updated at the module level. i.e. importing a module should not update the logging configuration.
In your app you can simply call (in the main section - it shouldn't really be anywhere else):
Or to just set everything within
And it would have the equivalent effect.
When used as a library, it would respect the logging configuration that was setup there.