diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-03-22 15:29:01 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-03-22 15:29:01 (GMT) |
commit | 804899b4ab873144ffc12c145fc4266489454c21 (patch) | |
tree | c89bb1594b095118133cce17144ce430f8c1c3e2 /Doc | |
parent | 73c22e9df2ec56ae5ff756d4af39d819a43af178 (diff) | |
download | cpython-804899b4ab873144ffc12c145fc4266489454c21.zip cpython-804899b4ab873144ffc12c145fc4266489454c21.tar.gz cpython-804899b4ab873144ffc12c145fc4266489454c21.tar.bz2 |
logging: Added getChild utility method to Logger and added isEnabledFor method to LoggerAdapter.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/logging.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 10772b4..96fd428 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -894,6 +894,16 @@ instantiated directly, but always through the module-level function :const:`NOTSET` is found, and that value is returned. +.. method:: Logger.getChild(suffix) + + Returns a logger which is a descendant to this logger, as determined by the suffix. + Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return the same + logger as would be returned by ``logging.getLogger('abc.def.ghi')``. This is a + convenience method, useful when the parent logger is named using e.g. ``__name__`` + rather than a literal string. + + .. versionadded:: 2.7 + .. method:: Logger.debug(msg[, *args[, **kwargs]]) Logs a message with level :const:`DEBUG` on this logger. The *msg* is the @@ -2472,6 +2482,11 @@ methods of :class:`Logger`, i.e. :meth:`debug`, :meth:`info`, :meth:`warning`, methods have the same signatures as their counterparts in :class:`Logger`, so you can use the two types of instances interchangeably. +.. versionchanged:: 2.7 + +The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This method +delegates to the underlying logger. + Thread Safety ------------- |