timber 1.1.1 → 1.1.2
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/README.md +9 -5
- data/lib/timber/events/custom.rb +1 -1
- data/lib/timber/version.rb +1 -1
- data/spec/timber/logger_spec.rb +2 -2
- 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: 711c51f2448d07c0149c2c13fe73d15b42d5314e
|
4
|
+
data.tar.gz: 1cedd7c199a732958fab544e6890e9b4589071a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1143f0d28d2b797be5b852fd835b62bdd0fb5aeaac3ace0f680e96301b86d5df4d93ee9d8a8f40dbbf1b84a244c8bce4abe793240eeef475650afe9520331f
|
7
|
+
data.tar.gz: ec709d117addb3085ac60c310c264c27ffc4f4b9c2bc1811cd2857302974131d53664c285dd11fbc798f56c49bca5d7b80a4f5afd0bdb11c753f924721994e21
|
data/README.md
CHANGED
@@ -132,7 +132,10 @@ Timber will *never* deviate from the public `::Logger` interface in *any* way.
|
|
132
132
|
|
133
133
|
<details><summary><strong>Tagging logs</strong></summary><p>
|
134
134
|
|
135
|
-
|
135
|
+
Tags provide a quick way to identify logs. They work just like any tagging system.
|
136
|
+
In the context of logging, they prevent obstructing the log message to
|
137
|
+
accomplish the same thing, while also being a step down from creating a classified custom
|
138
|
+
event. If the event is meaningful in any way, we recommend creating a custom event.
|
136
139
|
|
137
140
|
```ruby
|
138
141
|
logger.info(message: "My log message", tag: "tag")
|
@@ -164,7 +167,7 @@ end
|
|
164
167
|
|
165
168
|
</p></details>
|
166
169
|
|
167
|
-
<details><summary><strong>Timings
|
170
|
+
<details><summary><strong>Timings</strong></summary><p>
|
168
171
|
|
169
172
|
Timings allow you to easily capture one-off timings in your code; a simple
|
170
173
|
way to benchmark code execution:
|
@@ -297,6 +300,10 @@ gem 'timber'
|
|
297
300
|
|
298
301
|
<details><summary><strong>Rails (all versions, including edge)</strong></summary><p>
|
299
302
|
|
303
|
+
👉 **Prefer examples?** Checkout our the [Timber install example pull request](https://github.com/timberio/ruby-rails-example-app/pulls/1)
|
304
|
+
|
305
|
+
---
|
306
|
+
|
300
307
|
*Replace* any existing `config.logger=` calls in `config/environments/production.rb` with:
|
301
308
|
|
302
309
|
```ruby
|
@@ -305,9 +312,6 @@ gem 'timber'
|
|
305
312
|
config.logger = ActiveSupport::TaggedLogging.new(Timber::Logger.new(STDOUT))
|
306
313
|
```
|
307
314
|
|
308
|
-
* Prefer examples? Checkout our [Ruby / Rails example app](https://github.com/timberio/ruby-rails-example-app),
|
309
|
-
you can see all changes by [search for "timber-change"](https://github.com/timberio/ruby-rails-example-app/search?utf8=%E2%9C%93&q=timber-change&type=Code).
|
310
|
-
|
311
315
|
---
|
312
316
|
|
313
317
|
</p></details>
|
data/lib/timber/events/custom.rb
CHANGED
data/lib/timber/version.rb
CHANGED
data/spec/timber/logger_spec.rb
CHANGED
@@ -47,7 +47,7 @@ describe Timber::Logger, :rails_23 => true do
|
|
47
47
|
expect(Timber::Events).to receive(:build).with(message).and_call_original
|
48
48
|
logger.info(message)
|
49
49
|
expect(io.string).to start_with("payment rejected @metadata {\"level\":\"info\",\"dt\":\"2016-09-01T12:00:00.000000Z\",")
|
50
|
-
expect(io.string).to include("\"event\":{\"
|
50
|
+
expect(io.string).to include("\"event\":{\"custom\":{\"payment_rejected\":{\"customer_id\":\"abcde1234\",\"amount\":100}}}")
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should log properly when an event is passed" do
|
@@ -77,7 +77,7 @@ describe Timber::Logger, :rails_23 => true do
|
|
77
77
|
{message: "payment rejected", payment_rejected: {customer_id: "abcde1234", amount: 100}}
|
78
78
|
end
|
79
79
|
expect(io.string).to start_with("payment rejected @metadata {\"level\":\"info\",\"dt\":\"2016-09-01T12:00:00.000000Z\",")
|
80
|
-
expect(io.string).to include("\"event\":{\"
|
80
|
+
expect(io.string).to include("\"event\":{\"custom\":{\"payment_rejected\":{\"customer_id\":\"abcde1234\",\"amount\":100}}}")
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should escape new lines" 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: 1.1.
|
4
|
+
version: 1.1.2
|
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-02-
|
11
|
+
date: 2017-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|