Skip to content

Commit 0b21ae2

Browse files
fix(debug): Do not consider parent loggers for debug logging
This reverts commit 3793084, which made the SDK consider parent loggers when determining if the Sentry SDK should log debug messages. However, we should not consider parent loggers, since we only want the SDK to log debug messages when configured to do so via `debug=True` (in `sentry_sdk.init`), the `SENTRY_DEBUG` environment variable, or via a specific logger configuration for `sentry_sdk.errors`. With 3793084, a custom root logger configuration would also cause SDK logs to be emitted. The issue 3793084 was meant to fix (#3944) appears to have been caused by user error, not a bug in the SDK. Fixes #4266
1 parent 6000f87 commit 0b21ae2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/debug.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def filter(self, record):
1919

2020
def init_debug_support():
2121
# type: () -> None
22-
if not logger.hasHandlers():
22+
if not logger.handlers:
2323
configure_logger()
2424

2525

0 commit comments

Comments
 (0)