mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #15541: Correct anomaly in logging.exception. Thanks to Ned Batchelder for the report.
This commit is contained in:
parent
8ba844ac14
commit
947f358a06
1 changed files with 6 additions and 4 deletions
|
@ -1173,11 +1173,12 @@ class Logger(Filterer):
|
||||||
if self.isEnabledFor(ERROR):
|
if self.isEnabledFor(ERROR):
|
||||||
self._log(ERROR, msg, args, **kwargs)
|
self._log(ERROR, msg, args, **kwargs)
|
||||||
|
|
||||||
def exception(self, msg, *args):
|
def exception(self, msg, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Convenience method for logging an ERROR with exception information.
|
Convenience method for logging an ERROR with exception information.
|
||||||
"""
|
"""
|
||||||
self.error(msg, exc_info=1, *args)
|
kwargs['exc_info'] = 1
|
||||||
|
self.error(msg, *args, **kwargs)
|
||||||
|
|
||||||
def critical(self, msg, *args, **kwargs):
|
def critical(self, msg, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
@ -1582,12 +1583,13 @@ def error(msg, *args, **kwargs):
|
||||||
basicConfig()
|
basicConfig()
|
||||||
root.error(msg, *args, **kwargs)
|
root.error(msg, *args, **kwargs)
|
||||||
|
|
||||||
def exception(msg, *args):
|
def exception(msg, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
Log a message with severity 'ERROR' on the root logger,
|
Log a message with severity 'ERROR' on the root logger,
|
||||||
with exception information.
|
with exception information.
|
||||||
"""
|
"""
|
||||||
error(msg, exc_info=1, *args)
|
kwargs['exc_info'] = 1
|
||||||
|
error(msg, *args, **kwargs)
|
||||||
|
|
||||||
def warning(msg, *args, **kwargs):
|
def warning(msg, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue