[issue34307] NullHandler init refusing arguments

Vinay Sajip report at bugs.python.org
Wed Aug 1 13:50:25 EDT 2018


Vinay Sajip <vinay_sajip at yahoo.co.uk> added the comment:

> I expected it to be a "dummy" handler that might accept any argument

I don't know why you expected that, but your expectation wasn't valid. You will need to define your own BaseHandler which handles any arguments passed by your logging configuration.

NullHandler's __init__ is inherited from logging.Handler. There are no plans to change that. The documentation for it states:

"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."

This does not indicate that it is suitable for use as a base class. If you want to use a base class for your handler, use logging.Handler.

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34307>
_______________________________________


More information about the Python-bugs-list mailing list