File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -91,14 +91,18 @@ def setup_once():
9191
9292 def sentry_patched_callhandlers (self , record ):
9393 # type: (Any, LogRecord) -> Any
94+ # keeping a local reference because the
95+ # global might be discarded on shutdown
96+ ignored_loggers = _IGNORED_LOGGERS
97+
9498 try :
9599 return old_callhandlers (self , record )
96100 finally :
97101 # This check is done twice, once also here before we even get
98102 # the integration. Otherwise we have a high chance of getting
99103 # into a recursion error when the integration is resolved
100104 # (this also is slower).
101- if record .name not in _IGNORED_LOGGERS :
105+ if ignored_loggers is not None and record .name not in ignored_loggers :
102106 integration = Hub .current .get_integration (LoggingIntegration )
103107 if integration is not None :
104108 integration ._handle_record (record )
You can’t perform that action at this time.
0 commit comments