timber 2.0.16 → 2.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/timber/log_entry.rb +5 -1
- data/lib/timber/version.rb +1 -1
- data/spec/timber/logger_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1cbf6e1fada619873ed59f75deef55f365a3dae
|
|
4
|
+
data.tar.gz: 38abf4a05950039c65fc11c4ba52f803fed71085
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9457963527f193130bbe8262b62d40ee0b3f917fe4c61a4e18cf2c1a3b733cc8187ab4dbaf5792080c078e7184472a744ec7190510ee875ee6bc51ba5c64008
|
|
7
|
+
data.tar.gz: 47e70a59700fcd56171f3b38e6996cbd6d7a0e5b28feaf8baae530206a114823e1ff84dfd7ed58c10f4f37ec542e679093e8aae75c3c9a13588ae207001864cf
|
data/lib/timber/log_entry.rb
CHANGED
|
@@ -23,7 +23,11 @@ module Timber
|
|
|
23
23
|
@level = level
|
|
24
24
|
@time = time.utc
|
|
25
25
|
@progname = progname
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
# If the message is not a string we call inspect to ensure it is a string.
|
|
28
|
+
# This follows the default behavior set by ::Logger
|
|
29
|
+
# See: https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L615
|
|
30
|
+
@message = message.is_a?(String) ? message : message.inspect
|
|
27
31
|
@tags = options[:tags]
|
|
28
32
|
@time_ms = options[:time_ms]
|
|
29
33
|
|
data/lib/timber/version.rb
CHANGED
data/spec/timber/logger_spec.rb
CHANGED
|
@@ -18,6 +18,11 @@ describe Timber::Logger, :rails_23 => true do
|
|
|
18
18
|
expect(io.string).to start_with("this is a test @metadata {\"level\":\"info\",\"dt\":\"2016-09-01T12:00:00.000000Z\"")
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
it "should non-strings" do
|
|
22
|
+
logger.info(true)
|
|
23
|
+
expect(io.string).to start_with("true @metadata")
|
|
24
|
+
end
|
|
25
|
+
|
|
21
26
|
context "with a context" do
|
|
22
27
|
let(:http_context) do
|
|
23
28
|
Timber::Contexts::HTTP.new(
|
|
@@ -170,6 +175,11 @@ describe Timber::Logger, :rails_23 => true do
|
|
|
170
175
|
expect(io.string).to include('"level":"info"')
|
|
171
176
|
expect(io.string).to include('"tags":["tag"]')
|
|
172
177
|
end
|
|
178
|
+
|
|
179
|
+
it "should accept non-string messages" do
|
|
180
|
+
logger.info(true)
|
|
181
|
+
expect(io.string).to start_with("true @metadata")
|
|
182
|
+
end
|
|
173
183
|
end
|
|
174
184
|
|
|
175
185
|
describe "#error" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: timber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Timber Technologies, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-04-
|
|
11
|
+
date: 2017-04-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: msgpack
|