File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -54,15 +54,17 @@ def setup_once():
5454 old_callhandlers = logging .Logger .callHandlers
5555
5656 def sentry_patched_callhandlers (self , record ):
57- # This check is done twice, once also here before we even get
58- # the integration. Otherwise we have a high chance of getting
59- # into a recursion error when the integration is resolved
60- # (this also is slower).
61- if record .name not in _IGNORED_LOGGERS :
62- integration = Hub .current .get_integration (LoggingIntegration )
63- if integration is not None :
64- integration ._handle_record (record )
65- return old_callhandlers (self , record )
57+ try :
58+ return old_callhandlers (self , record )
59+ finally :
60+ # This check is done twice, once also here before we even get
61+ # the integration. Otherwise we have a high chance of getting
62+ # into a recursion error when the integration is resolved
63+ # (this also is slower).
64+ if record .name not in _IGNORED_LOGGERS :
65+ integration = Hub .current .get_integration (LoggingIntegration )
66+ if integration is not None :
67+ integration ._handle_record (record )
6668
6769 logging .Logger .callHandlers = sentry_patched_callhandlers
6870
You can’t perform that action at this time.
0 commit comments