Derived from the flake8-logging linter.
Fix is sometimes available.
This rule is unstable and in preview. The
--preview flag is required for use.
What it does#
Checks for direct instantiation of
logging.Logger, as opposed to using
Why is this bad?#
The Logger Objects documentation states that:
Note that Loggers should NEVER be instantiated directly, but always through the module-level function
If a logger is directly instantiated, it won't be added to the logger tree, and will bypass all configuration. Messages logged to it will only be sent to the "handler of last resort", skipping any filtering or formatting.