Skip to content

Commit 8ea782b

Browse files
Force UTF-8 encoding for frame label (#10)
* Force UTF-8 encoding for frame label * 🔥 * Add test * Bump version
1 parent 797a823 commit 8ea782b

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1818
## [0.1.3] - 2021-06-11
1919

2020
- Fixed detection of the frame that calls the logger.
21+
22+
## [0.1.7] - 2021-08-16
23+
24+
- Fixed runtime context's frame label encoding.

lib/logtail/log_entry.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def convert_to_runtime_context(frame)
129129
{
130130
file: path_relative_to_app_root(frame),
131131
line: frame.lineno,
132-
frame_label: frame.label,
132+
frame_label: frame.label.dup.force_encoding('UTF-8'),
133133
}
134134
end
135135

lib/logtail/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Logtail
2-
VERSION = "0.1.6"
2+
VERSION = "0.1.7"
33
end

spec/logtail/log_entry_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
expect(hash[:context][:runtime][:file]).to end_with('/spec/logtail/log_entry_spec.rb')
3131
expect(hash[:context][:runtime][:line]).to be(25)
3232
expect(hash[:context][:runtime][:frame_label]).to_not be_nil
33+
expect(hash[:context][:runtime][:frame_label].encoding.to_s).to eq('UTF-8')
3334
end
3435
end
3536
end

0 commit comments

Comments
 (0)