summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-02-12 16:24:45 (GMT)
committerGitHub <noreply@github.com>2024-02-12 16:24:45 (GMT)
commit91822018eeba12a6c9eabbc748363b2fd4291b30 (patch)
tree048ca3476c3f2bccf0ce450c2d23e3b14bcffe7a /Lib/logging
parent814466101790d4381ca4800c3d3b0cc0aad50c62 (diff)
downloadcpython-91822018eeba12a6c9eabbc748363b2fd4291b30.zip
cpython-91822018eeba12a6c9eabbc748363b2fd4291b30.tar.gz
cpython-91822018eeba12a6c9eabbc748363b2fd4291b30.tar.bz2
gh-115233: Fix an example in the Logging Cookbook (GH-115325)
Also add more tests for LoggerAdapter. Also support stacklevel in LoggerAdapter._log().
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index 684b58d..fcec9e7 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1949,18 +1949,11 @@ class LoggerAdapter(object):
"""
return self.logger.hasHandlers()
- def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False):
+ def _log(self, level, msg, args, **kwargs):
"""
Low-level log implementation, proxied to allow nested logger adapters.
"""
- return self.logger._log(
- level,
- msg,
- args,
- exc_info=exc_info,
- extra=extra,
- stack_info=stack_info,
- )
+ return self.logger._log(level, msg, args, **kwargs)
@property
def manager(self):