timber 2.0.16 → 2.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1038cc42a24a78320336990a6773fd333c622798
4
- data.tar.gz: adc0a024f67b5bf31c8c11fde6c322daf790d621
3
+ metadata.gz: b1cbf6e1fada619873ed59f75deef55f365a3dae
4
+ data.tar.gz: 38abf4a05950039c65fc11c4ba52f803fed71085
5
5
  SHA512:
6
- metadata.gz: 4b5e9b1d8a39a5bf05b7f36c552192629f8384737533e8970f301308ef1971da83a1eca589f3cce588a391544e8487ba4db16e2a8d743b2d8bf9811fdf82e8bb
7
- data.tar.gz: 08a59f9d54d3e01f12f73ea627593dbe3f5b98493947deee31a6fe05c675fb2839083e3c9eea9cd29bee062bb682c7ca0fc57836b5969412d987587a04216d5f
6
+ metadata.gz: b9457963527f193130bbe8262b62d40ee0b3f917fe4c61a4e18cf2c1a3b733cc8187ab4dbaf5792080c078e7184472a744ec7190510ee875ee6bc51ba5c64008
7
+ data.tar.gz: 47e70a59700fcd56171f3b38e6996cbd6d7a0e5b28feaf8baae530206a114823e1ff84dfd7ed58c10f4f37ec542e679093e8aae75c3c9a13588ae207001864cf
@@ -23,7 +23,11 @@ module Timber
23
23
  @level = level
24
24
  @time = time.utc
25
25
  @progname = progname
26
- @message = message
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
 
@@ -1,3 +1,3 @@
1
1
  module Timber
2
- VERSION = "2.0.16"
2
+ VERSION = "2.0.17"
3
3
  end
@@ -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.16
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-21 00:00:00.000000000 Z
11
+ date: 2017-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack