mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
logging: hasHandlers additions documented.
This commit is contained in:
parent
ae7d7fa0fe
commit
83eadd1488
2 changed files with 14 additions and 0 deletions
|
@ -1129,6 +1129,18 @@ instantiated directly, but always through the module-level function
|
||||||
This is a factory method which can be overridden in subclasses to create
|
This is a factory method which can be overridden in subclasses to create
|
||||||
specialized :class:`LogRecord` instances.
|
specialized :class:`LogRecord` instances.
|
||||||
|
|
||||||
|
.. method:: Logger.hasHandlers()
|
||||||
|
|
||||||
|
Checks to see if this logger has any handlers configured. This is done by
|
||||||
|
looking for handlers in this logger and its parents in the logger hierarchy.
|
||||||
|
Returns True if a handler was found, else False. The method stops searching
|
||||||
|
up the hierarchy whenever a logger with the "propagate" attribute set to
|
||||||
|
False is found - that will be the last logger which is checked for the
|
||||||
|
existence of handlers.
|
||||||
|
|
||||||
|
.. versionadded:: 3.2
|
||||||
|
|
||||||
|
The :meth:`hasHandlers` method was not present in previous versions.
|
||||||
|
|
||||||
.. _minimal-example:
|
.. _minimal-example:
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- logging: Added hasHandlers() method to Logger and LoggerAdapter.
|
||||||
|
|
||||||
- Issue #1686: Fix string.Template when overriding the pattern attribute.
|
- Issue #1686: Fix string.Template when overriding the pattern attribute.
|
||||||
|
|
||||||
- Issue #9854: SocketIO objects now observe the RawIOBase interface in
|
- Issue #9854: SocketIO objects now observe the RawIOBase interface in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue