mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Added some methods to LoggerAdapter, and updated documentation.
This commit is contained in:
parent
ceff566886
commit
c84f016988
5 changed files with 32 additions and 9 deletions
|
@ -2599,8 +2599,8 @@ should, then :meth:`flush` is expected to do the needful.
|
|||
.. method:: flush()
|
||||
|
||||
For a :class:`MemoryHandler`, flushing means just sending the buffered
|
||||
records to the target, if there is one. Override if you want different
|
||||
behavior.
|
||||
records to the target, if there is one. The buffer is also cleared when
|
||||
this happens. Override if you want different behavior.
|
||||
|
||||
|
||||
.. method:: setTarget(target)
|
||||
|
@ -2972,15 +2972,18 @@ __ context-info_
|
|||
'extra'. The return value is a (*msg*, *kwargs*) tuple which has the
|
||||
(possibly modified) versions of the arguments passed in.
|
||||
|
||||
In addition to the above, :class:`LoggerAdapter` supports all the logging
|
||||
In addition to the above, :class:`LoggerAdapter` supports the following
|
||||
methods of :class:`Logger`, i.e. :meth:`debug`, :meth:`info`, :meth:`warning`,
|
||||
:meth:`error`, :meth:`exception`, :meth:`critical` and :meth:`log`. These
|
||||
methods have the same signatures as their counterparts in :class:`Logger`, so
|
||||
you can use the two types of instances interchangeably.
|
||||
:meth:`error`, :meth:`exception`, :meth:`critical`, :meth:`log`,
|
||||
:meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel`,
|
||||
:meth:`hasHandlers`. These methods have the same signatures as their
|
||||
counterparts in :class:`Logger`, so you can use the two types of instances
|
||||
interchangeably.
|
||||
|
||||
.. versionchanged:: 3.2
|
||||
The :meth:`isEnabledFor` method was added to :class:`LoggerAdapter`. This
|
||||
method delegates to the underlying logger.
|
||||
The :meth:`isEnabledFor`, :meth:`getEffectiveLevel`, :meth:`setLevel` and
|
||||
:meth:`hasHandlers` methods were added to :class:`LoggerAdapter`. These
|
||||
methods delegate to the underlying logger.
|
||||
|
||||
|
||||
Thread Safety
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue