diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-20 10:31:18 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-09-20 10:31:18 (GMT) |
commit | 83eadd148895abe739026a76f939bec30a4ee3dd (patch) | |
tree | c148bf44fe2d71813c129dc9fe7a693ad6328a89 /Doc/library/logging.rst | |
parent | ae7d7fa0fedca5b3ceb4913623e31630e1498d68 (diff) | |
download | cpython-83eadd148895abe739026a76f939bec30a4ee3dd.zip cpython-83eadd148895abe739026a76f939bec30a4ee3dd.tar.gz cpython-83eadd148895abe739026a76f939bec30a4ee3dd.tar.bz2 |
logging: hasHandlers additions documented.
Diffstat (limited to 'Doc/library/logging.rst')
-rw-r--r-- | Doc/library/logging.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 7b579f1..5d62d50 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -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 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: |