Skip to content

Commit 73fc8a9

Browse files
committed
Using safe_repr
1 parent 6c2b848 commit 73fc8a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sentry_sdk/integrations/logging.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sentry_sdk
66
from sentry_sdk.client import BaseClient
77
from sentry_sdk.utils import (
8+
safe_repr,
89
to_string,
910
event_from_exception,
1011
current_stacktrace,
@@ -364,7 +365,7 @@ def _capture_log_from_record(client, record):
364365
if isinstance(record.args, tuple):
365366
for i, arg in enumerate(record.args):
366367
attrs[f"sentry.message.parameters.{i}"] = (
367-
arg if isinstance(arg, str) else repr(arg)
368+
arg if isinstance(arg, str) else safe_repr(arg)
368369
)
369370
if record.lineno:
370371
attrs["code.line.number"] = record.lineno

0 commit comments

Comments
 (0)