Skip to content

Commit 9a5daba

Browse files
committed
feat: Add log_record to event hints
See getsentry#383
1 parent 1521257 commit 9a5daba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sentry_sdk/integrations/logging.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ def _emit(self, record):
157157
if hub.client is None:
158158
return
159159

160-
hint = None # type: Optional[Dict[str, Any]]
161160
client_options = hub.client.options
162161

163162
# exc_info might be None or (None, None, None)
@@ -169,7 +168,7 @@ def _emit(self, record):
169168
)
170169
elif record.exc_info and record.exc_info[0] is None:
171170
event = {}
172-
hint = None
171+
hint = {}
173172
with capture_internal_exceptions():
174173
event["threads"] = {
175174
"values": [
@@ -184,6 +183,9 @@ def _emit(self, record):
184183
}
185184
else:
186185
event = {}
186+
hint = {}
187+
188+
hint["log_record"] = record
187189

188190
event["level"] = _logging_to_event_level(record.levelname)
189191
event["logger"] = record.name

0 commit comments

Comments
 (0)