Skip to content

Commit 176f45e

Browse files
committed
Added todos
1 parent 92b7e6d commit 176f45e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test_sentry_logs.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ def test_logs_attributes(sentry_init, capture_envelopes):
100100
log_item = envelopes[0].items[0].payload.json
101101
assert log_item["body"]["stringValue"] == "The recorded value was 'some value'"
102102

103-
assert log_item["attributes"][1] == {"key": "attr_int", "value": {"intValue": "1"}} # ???
103+
assert log_item["attributes"][1] == {"key": "attr_int", "value": {"intValue": "1"}} # TODO: this is strange.
104104
assert log_item["attributes"][2] == {"key": "attr_float", "value": {"doubleValue": 2.0}}
105-
assert log_item["attributes"][3] == {"key": "attr_bool", "value": {"intValue": "True"}} # ???
105+
assert log_item["attributes"][3] == {"key": "attr_bool", "value": {"intValue": "True"}} # TODO: this is strange.
106106
assert log_item["attributes"][4] == {"key": "attr_string", "value": {"stringValue": "string attribute"}}
107107
assert log_item["attributes"][5] == {"key": "sentry.environment", "value": {"stringValue": "production"}}
108108
assert log_item["attributes"][6] == {"key": "sentry.release", "value": {"stringValue": mock.ANY}}
@@ -122,13 +122,13 @@ def test_logs_message_params(sentry_init, capture_envelopes):
122122
sentry_logger.warn("The recorded value was '{string_var}'", string_var="some string value")
123123

124124
assert envelopes[0].items[0].payload.json["body"]["stringValue"] == "The recorded value was '1'"
125-
assert envelopes[0].items[0].payload.json["attributes"][-1] == {"key": "sentry.message.parameters.int_var", "value": {'intValue': "1"}} # ???
125+
assert envelopes[0].items[0].payload.json["attributes"][-1] == {"key": "sentry.message.parameters.int_var", "value": {'intValue': "1"}} # TODO: this is strange.
126126

127127
assert envelopes[1].items[0].payload.json["body"]["stringValue"] == "The recorded value was '2.0'"
128128
assert envelopes[1].items[0].payload.json["attributes"][-1] == {"key": "sentry.message.parameters.float_var", "value": {'doubleValue': 2.0}}
129129

130130
assert envelopes[2].items[0].payload.json["body"]["stringValue"] == "The recorded value was 'False'"
131-
assert envelopes[2].items[0].payload.json["attributes"][-1] == {"key": "sentry.message.parameters.bool_var", "value": {'intValue': "False"}} # ???
131+
assert envelopes[2].items[0].payload.json["attributes"][-1] == {"key": "sentry.message.parameters.bool_var", "value": {'intValue': "False"}} # TODO: this is strange.
132132

133133
assert envelopes[3].items[0].payload.json["body"]["stringValue"] == "The recorded value was 'some string value'"
134134
assert envelopes[3].items[0].payload.json["attributes"][-1] == {"key": "sentry.message.parameters.string_var", "value": {'stringValue': "some string value"}}
@@ -137,6 +137,7 @@ def test_logs_message_params(sentry_init, capture_envelopes):
137137
def test_logs_message_old_style(sentry_init, capture_envelopes):
138138
"""
139139
This is how vars are passed to strings in old Python projects.
140+
TODO: Should we support this?
140141
"""
141142
sentry_init(enable_sentry_logs=True)
142143

@@ -151,6 +152,7 @@ def test_logs_message_old_style(sentry_init, capture_envelopes):
151152
def test_logs_message_format(sentry_init, capture_envelopes):
152153
"""
153154
This is another popular war how vars are passed to strings in old Python projects.
155+
TODO: Should we support this?
154156
"""
155157
sentry_init(enable_sentry_logs=True)
156158
envelopes = capture_envelopes()
@@ -164,6 +166,7 @@ def test_logs_message_format(sentry_init, capture_envelopes):
164166
def test_logs_message_f_string(sentry_init, capture_envelopes):
165167
"""
166168
This is the preferred way how vars are passed to strings in old Python projects.
169+
TODO: This we should definitely support.
167170
"""
168171
sentry_init(enable_sentry_logs=True)
169172
envelopes = capture_envelopes()
@@ -178,6 +181,7 @@ def test_logs_message_f_string(sentry_init, capture_envelopes):
178181
def test_logs_message_python_logging(sentry_init, capture_envelopes):
179182
"""
180183
This is how vars are passed to log messages when using Python logging module.
184+
TODO: We probably should also support this, to make it easier to migrate from the old logging module to the Sentry one.
181185
"""
182186
sentry_init(enable_sentry_logs=True)
183187
envelopes = capture_envelopes()

0 commit comments

Comments
 (0)