[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-01-27 Thread Michael P. Nitowski


New submission from Michael P. Nitowski :

Systems that aggregate logs like Sentry will group all captured warnings under 
the same event which makes it difficult to assess common warnings

--
components: Library (Lib)
messages: 411947
nosy: mnito
priority: normal
severity: normal
status: open
title: Logging captured warnings with a format string unnecessarily groups 
warnings together
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue46557>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-01-27 Thread Michael P. Nitowski


Change by Michael P. Nitowski :


--
keywords: +patch
pull_requests: +29154
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30975

___
Python tracker 
<https://bugs.python.org/issue46557>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-01-27 Thread Michael P. Nitowski


Michael P. Nitowski  added the comment:

Of course, here's an example script to reproduce:

```
import logging
import warnings

import sentry_sdk
from sentry_sdk.integrations.logging import LoggingIntegration

logging.captureWarnings(True)

sentry_logging = LoggingIntegration(
level=logging.INFO,
event_level=logging.WARNING
)

sentry_sdk.init(
"",
traces_sample_rate=1.0,
integrations=[
LoggingIntegration(
level=logging.INFO,
event_level=logging.WARNING
)
]
)

warnings.warn("A warning")
warnings.warn("Another warning")
```

I attached a file of what it looks like in the Sentry UI. Notice both warnings 
under the same issue. When logging warnings directly with the logging module, 
each message arrives as a separate issue. These warnings from the warnings 
module are both grouped together under the same issue since Sentry groups all 
logs with the same format string together.

--
Added file: https://bugs.python.org/file50592/Screen Shot 2022-01-27 at 8.09.37 
PM.png

___
Python tracker 
<https://bugs.python.org/issue46557>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com