Skip to content

Commit 27dece4

Browse files
committed
fix: Handler classes should not check for integration
1 parent 65890e1 commit 27dece4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

sentry_sdk/integrations/logging.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ def _emit(self, record):
137137
return
138138

139139
hub = Hub.current
140-
integration = hub.get_integration(LoggingIntegration)
141-
if integration is None:
140+
if hub.client is None:
142141
return
143142

144143
# exc_info might be None or (None, None, None)
@@ -185,9 +184,6 @@ def _emit(self, record):
185184
if not _can_record(record):
186185
return
187186

188-
hub = Hub.current
189-
integration = hub.get_integration(LoggingIntegration)
190-
if integration is None:
191-
return
192-
193-
hub.add_breadcrumb(_breadcrumb_from_record(record), hint={"log_record": record})
187+
Hub.current.add_breadcrumb(
188+
_breadcrumb_from_record(record), hint={"log_record": record}
189+
)

0 commit comments

Comments
 (0)