Issue #4384: Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging.

This commit is contained in:
Vinay Sajip 2008-12-03 23:22:58 +00:00
parent 7989a4dccb
commit 213faca204
4 changed files with 108 additions and 5 deletions

View file

@ -461,6 +461,12 @@ should have the desired effect. If an organisation produces a number of
libraries, then the logger name specified can be "orgname.foo" rather than
just "foo".
.. versionadded:: 2.7
The :class:`NullHandler` class was not present in previous versions, but is now
included, so that it need not be defined in library code.
Logging Levels
--------------
@ -553,6 +559,15 @@ provided:
#. :class:`HTTPHandler` instances send error messages to an HTTP server using
either ``GET`` or ``POST`` semantics.
#. :class:`NullHandler` instances do nothing with error messages. They are used
by library developers who want to use logging, but want to avoid the "No
handlers could be found for logger XXX" message which can be displayed if
the library user has not configured logging.
.. versionadded:: 2.7
The :class:`NullHandler` class was not present in previous versions.
The :class:`StreamHandler` and :class:`FileHandler` classes are defined in the
core logging package. The other handlers are defined in a sub- module,
:mod:`logging.handlers`. (There is also another sub-module,