mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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:
parent
7989a4dccb
commit
213faca204
4 changed files with 108 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue