mirror of https://github.com/python/cpython
bpo-46557: Log captured warnings without format string (GH-30975)
This commit is contained in:
parent
16995ed0f2
commit
d8066b420b
|
@ -2246,7 +2246,9 @@ def _showwarning(message, category, filename, lineno, file=None, line=None):
|
|||
logger = getLogger("py.warnings")
|
||||
if not logger.handlers:
|
||||
logger.addHandler(NullHandler())
|
||||
logger.warning("%s", s)
|
||||
# bpo-46557: Log str(s) as msg instead of logger.warning("%s", s)
|
||||
# since some log aggregation tools group logs by the msg arg
|
||||
logger.warning(str(s))
|
||||
|
||||
def captureWarnings(capture):
|
||||
"""
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Warnings captured by the logging module are now logged without a format string to prevent systems that group logs by the msg argument from grouping captured warnings together.
|
Loading…
Reference in New Issue