summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRomuald Brunet <romuald@chivil.com>2023-08-15 07:23:54 (GMT)
committerGitHub <noreply@github.com>2023-08-15 07:23:54 (GMT)
commita482e5bf0022f85424a6308529a9ad51f1bfbb71 (patch)
treef2d67ed61e2a8e005becbb1ae32b36d9e6646aa1 /Doc/library
parent580f357c663bd704a0903e4174cdf458cac56416 (diff)
downloadcpython-a482e5bf0022f85424a6308529a9ad51f1bfbb71.zip
cpython-a482e5bf0022f85424a6308529a9ad51f1bfbb71.tar.gz
cpython-a482e5bf0022f85424a6308529a9ad51f1bfbb71.tar.bz2
gh-76913: Add "merge extras" feature to LoggerAdapter (GH-107292)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/logging.rst11
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index b582c91..49e870e 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -1002,10 +1002,14 @@ LoggerAdapter Objects
information into logging calls. For a usage example, see the section on
:ref:`adding contextual information to your logging output <context-info>`.
-.. class:: LoggerAdapter(logger, extra)
+.. class:: LoggerAdapter(logger, extra, merge_extra=False)
Returns an instance of :class:`LoggerAdapter` initialized with an
- underlying :class:`Logger` instance and a dict-like object.
+ underlying :class:`Logger` instance, a dict-like object (*extra*), and a
+ boolean (*merge_extra*) indicating whether or not the *extra* argument of
+ individual log calls should be merged with the :class:`LoggerAdapter` extra.
+ The default behavior is to ignore the *extra* argument of individual log
+ calls and only use the one of the :class:`LoggerAdapter` instance
.. method:: process(msg, kwargs)
@@ -1037,6 +1041,9 @@ interchangeably.
Remove the undocumented ``warn()`` method which was an alias to the
``warning()`` method.
+.. versionchanged:: 3.13
+ The *merge_extra* argument was added.
+
Thread Safety
-------------