Skip to content

Commit ca4d04c

Browse files
committed
Allow ints, floats and booleans as values
1 parent 6ae5bef commit ca4d04c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sentry-ruby/lib/sentry/log_event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def serialize_attributes
3535

3636
@attributes.each do |key, value|
3737
result[key.to_s] = {
38-
value: value.to_s,
38+
value: value,
3939
type: value_type(value)
4040
}
4141
end

sentry-ruby/spec/sentry/log_event_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
hash = event.to_hash
9898

9999
expect(hash[:attributes]["string_attr"]).to eq({ value: "string value", type: "string" })
100-
expect(hash[:attributes]["integer_attr"]).to eq({ value: "42", type: "integer" })
101-
expect(hash[:attributes]["boolean_attr"]).to eq({ value: "true", type: "boolean" })
102-
expect(hash[:attributes]["float_attr"]).to eq({ value: "3.14", type: "double" })
100+
expect(hash[:attributes]["integer_attr"]).to eq({ value: 42, type: "integer" })
101+
expect(hash[:attributes]["boolean_attr"]).to eq({ value: true, type: "boolean" })
102+
expect(hash[:attributes]["float_attr"]).to eq({ value: 3.14, type: "double" })
103103
end
104104
end
105105
end

0 commit comments

Comments
 (0)