timber 2.0.5 → 2.0.6

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: 97ff67ce5ee816c4e3d97ffdbc1cf23694ee64ca
4
- data.tar.gz: 7c0cacdf4b39ac5c5317efbcd5ad9b12988566af
3
+ metadata.gz: e2575049d24c209a60b30d3c307d948a4dd6fd96
4
+ data.tar.gz: 5f2fa7d925b449836a7b17f6ade39a69d9d2138e
5
5
  SHA512:
6
- metadata.gz: 868987f6f4841a52f50b564068f4a93da5692154056d12e56cfdb951958fa868eada0bd53ac78484e0a79263cf624bd8f3fa13254961b5a8436f9fd8e2906222
7
- data.tar.gz: fc9890d02ac9ca868d8ba28f3e18e6d940f95a3be97f87b9c989278493eb4d4093e2770cf1f6d0837e662e08f2e0e562241569a5eff34b141817efc7ff442993
6
+ metadata.gz: c6cefa704196b834836c4ec586a2aba41a27bdab0e11d9ca943a0ffca8425768c45c2ce71fd35f05f8aab935f2ad822e556d930736d7055f5a6515872b7f97de
7
+ data.tar.gz: afc046c48f805a946fd49353b3a56629bc1557df302790d88b9c15fb51fa5d16f2cf4569e63f5fa7a14d9ece7b4bedf16646c64e3005435c154809231af5da61
data/README.md CHANGED
@@ -14,31 +14,36 @@
14
14
  ## Overview
15
15
 
16
16
  Timber for Ruby is an optional upgrade you can install for Ruby apps on the
17
- [Timber.io logging platform](https://timber.io). It turns your once raw text logs into
18
- [rich JSON events that contain critical event and context data](https://timber.io/docs/elixir/automatic-schema-and-fields).
19
- These events conform to the [Timber normalized JSON schema](https://timber.io/docs/app/schema-fields)
20
- and dramatically improve the quality of your logs; allowing you to filter out the noise and solve
21
- problems faster.
17
+ [Timber.io logging platform](https://timber.io). Instead of completely replacing your log messages,
18
+ Timber automatically augments your logs with JSON metadata. Essentially turning them into
19
+ [rich events with context](https://timber.io/docs/ruby/events-and-context). This preserves the
20
+ readability of your logs while still dramatically improving the quality of your data.
21
+ The end result: better logging and faster problem solving.
22
22
 
23
- For example, Timber turns this:
23
+
24
+ ## How it works
25
+
26
+ For example, Timber turns this familiar raw text log:
24
27
 
25
28
  ```
26
29
  Sent 200 in 45.ms
27
30
  ```
28
31
 
29
- Into this:
32
+ Into a rich [`http_server_response` event](https://timber.io/docs/ruby/events-and-context/http-server-response-event/).
30
33
 
31
34
  ```
32
35
  Sent 200 in 45.2ms @metadata {"dt": "2017-02-02T01:33:21.154345Z", "level": "info", "context": {"user": {"id": 1, "name": "Ben Johnson"}, "http": {"method": "GET", "host": "timber.io", "path": "/path", "request_id": "abcd1234"}}, "event": {"http_server_response": {"status": 200, "time_ms": 45.2}}}
33
36
  ```
34
37
 
35
- Allowing you to run extremely powerful queries in the [Timber console](https://timber.io/docs/app/overview/) like:
38
+ In the [Timber console](https://app.timber.io) simply
39
+ [click the line to view this metdata](https://timber.io/docs/app/tutorials/view-metadata/).
40
+ Moreover, this data allows you to run powerful queries like:
36
41
 
37
42
  1. `context.request_id:abcd1234` - View all logs generated for a specific request.
38
43
  2. `context.user.id:1` - View logs generated by a specific user.
39
- 3. `type:http_response` - View specific events (exceptions, sql queries, etc)
44
+ 3. `type:http_server_response` - View specific events (exceptions, sql queries, etc)
40
45
  4. `http_server_response.time_ms:>=1000` - View slow responses with the ability to zoom out and view them in context (request, user, etc).
41
- 5. `level:error` - Levels in your logs!
46
+ 5. `level:info` - Levels in your logs!
42
47
 
43
48
  For a complete overview, see the [Timber for Ruby docs](https://timber.io/docs/ruby/overview/).
44
49
 
@@ -114,19 +114,19 @@ module Timber
114
114
  task_message = "Configuring Timber in #{path}"
115
115
  write Messages.task_start(task_message)
116
116
 
117
+ init_logger_code = defined?(::ActiveSupport::TaggedLogging) ? "ActiveSupport::TaggedLogging.new(logger)" : "logger"
118
+
117
119
  logger_code = \
118
120
  case log_device_type
119
121
  when :http
120
122
  api_key_code = options[:api_key_code] || raise(ArgumentError.new("the :api_key_code option is required"))
121
123
 
122
- logger_code = defined?(::ActiveSupport::TaggedLogging) ? "ActiveSupport::TaggedLogging.new(logger)" : "logger"
123
-
124
124
  code = <<-CODE
125
125
  # Install the Timber.io logger, send logs over HTTP
126
126
  log_device = Timber::LogDevices::HTTP.new(#{api_key_code})
127
127
  logger = Timber::Logger.new(log_device)
128
128
  logger.level = config.log_level
129
- config.logger = #{logger_code}
129
+ config.logger = #{init_logger_code}
130
130
  CODE
131
131
  code.rstrip
132
132
 
@@ -135,7 +135,7 @@ CODE
135
135
  # Install the Timber.io logger, send logs to STDOUT
136
136
  logger = Timber::Logger.new(STDOUT)
137
137
  logger.level = config.log_level
138
- config.logger = #{logger_code}
138
+ config.logger = #{init_logger_code}
139
139
  CODE
140
140
  code.rstrip
141
141
  end
@@ -1,3 +1,3 @@
1
1
  module Timber
2
- VERSION = "2.0.5"
2
+ VERSION = "2.0.6"
3
3
  end
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.5
4
+ version: 2.0.6
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-03-24 00:00:00.000000000 Z
11
+ date: 2017-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack