According to python's documentation,
The NullHandler class, located in the core logging package, does not do any formatting or output. It is essentially a ‘no-op’ handler for use by library developers.
If it doesn't print to anything, what is the use of this handler at all? Why would one go to lengths to write loggers and then use null handler to not print anything?
So you can keep your logger.warning('Whatever') statements in your code, but conditionally inject a logger that entirely disregards them if you don't want a log in certain situations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With