Skip to content

Commit dbbe5ef

Browse files
committed
fix more tests
1 parent 007144e commit dbbe5ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

sentry_sdk/_experimental_logger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def _capture_log(severity_text, severity_number, template, **kwargs):
1414
attrs = {
1515
"sentry.message.template": template,
1616
} # type: dict[str, str | bool | float | int]
17+
if "attributes" in kwargs:
18+
attrs.update(kwargs.pop("attributes"))
1719
for k, v in kwargs.items():
1820
attrs[f"sentry.message.parameters.{k}"] = v
1921

tests/test_logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_logs_message_params(sentry_init, capture_envelopes):
186186
envelopes[3].items[0].payload.json["body"]["stringValue"]
187187
== "The recorded value was 'some string value'"
188188
)
189-
assert otel_attributes_to_dict(envelopes[2].items[0].payload.json["attributes"])[
189+
assert otel_attributes_to_dict(envelopes[3].items[0].payload.json["attributes"])[
190190
"sentry.message.parameters.string_var"
191191
] == {"stringValue": "some string value"}
192192

0 commit comments

Comments
 (0)