Skip to content

Commit 8992f7c

Browse files
committed
Do not use a repr for template
1 parent 5da81d5 commit 8992f7c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

sentry_sdk/integrations/logging.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,9 @@ def _capture_log_from_record(client, record):
357357
# type: (BaseClient, LogRecord) -> None
358358
scope = sentry_sdk.get_current_scope()
359359
otel_severity_number, otel_severity_text = _python_level_to_otel(record.levelno)
360-
attrs = {
361-
"sentry.message.template": (
362-
record.msg if isinstance(record.msg, str) else repr(record.msg)
363-
),
364-
} # type: dict[str, str | bool | float | int]
360+
attrs = {} # type: dict[str, str | bool | float | int]
361+
if isinstance(record.msg, str):
362+
attrs["sentry.message.template"] = record.msg
365363
if record.args is not None:
366364
if isinstance(record.args, tuple):
367365
for i, arg in enumerate(record.args):

0 commit comments

Comments
 (0)