timber 2.0.17 → 2.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/timber/events/controller_call.rb +1 -1
- data/lib/timber/events/exception.rb +1 -1
- data/lib/timber/events/http_client_request.rb +1 -1
- data/lib/timber/events/http_client_response.rb +1 -1
- data/lib/timber/events/http_server_request.rb +1 -1
- data/lib/timber/events/http_server_response.rb +1 -1
- data/lib/timber/events/sql_query.rb +1 -1
- data/lib/timber/events/template_render.rb +1 -1
- data/lib/timber/integrations/active_record/log_subscriber.rb +0 -1
- data/lib/timber/integrations/active_record/log_subscriber/timber_log_subscriber.rb +6 -0
- data/lib/timber/log_entry.rb +1 -1
- data/lib/timber/version.rb +1 -1
- data/spec/timber/integrations/action_controller/log_subscriber_spec.rb +1 -1
- data/spec/timber/integrations/action_dispatch/debug_exceptions_spec.rb +1 -1
- data/spec/timber/integrations/action_view/log_subscriber_spec.rb +1 -1
- data/spec/timber/integrations/active_record/log_subscriber_spec.rb +1 -1
- data/spec/timber/logger_spec.rb +1 -1
- 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: 2e4d4e220779ebe8ea442c98c2f03f36cf12f438
|
4
|
+
data.tar.gz: e995c553745a8839d306eea480d359063a779b9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca96f8e714fef59f4a14155b0376094928171636f2ca4cbb372ef928112d5e4c9c1f4be40c2cb856f94568d4139066e95d4544380fa043540c831a138f06a5d0
|
7
|
+
data.tar.gz: 41e76ccddb69c9961330560d78c9d82d941e2af0ad91e6e506ae99628147ea3ff96f43c9979299fdaa84b3638adaf88512e1e1532f11c7b33aae8a5287853031
|
@@ -7,7 +7,6 @@ module Timber
|
|
7
7
|
# @private
|
8
8
|
class LogSubscriber < Integrator
|
9
9
|
def initialize
|
10
|
-
require "active_record/log_subscriber"
|
11
10
|
require "timber/integrations/active_record/log_subscriber/timber_log_subscriber"
|
12
11
|
rescue LoadError => e
|
13
12
|
raise RequirementNotMetError.new(e.message)
|
@@ -1,3 +1,9 @@
|
|
1
|
+
# We require all of ActiveRecord because #logger usses ActiveRecord::Base.
|
2
|
+
# We can't require active_record/base directly because ActiveRecord does not require
|
3
|
+
# files properly.
|
4
|
+
require "active_record"
|
5
|
+
require "active_record/log_subscriber"
|
6
|
+
|
1
7
|
module Timber
|
2
8
|
module Integrations
|
3
9
|
module ActiveRecord
|
data/lib/timber/log_entry.rb
CHANGED
@@ -5,7 +5,7 @@ module Timber
|
|
5
5
|
# `Logger` and the log device that you set it up with.
|
6
6
|
class LogEntry #:nodoc:
|
7
7
|
DT_PRECISION = 6.freeze
|
8
|
-
SCHEMA = "https://raw.githubusercontent.com/timberio/log-event-json-schema/
|
8
|
+
SCHEMA = "https://raw.githubusercontent.com/timberio/log-event-json-schema/2.0.1/schema.json".freeze
|
9
9
|
|
10
10
|
attr_reader :context_snapshot, :event, :level, :message, :progname, :tags, :time, :time_ms
|
11
11
|
|
data/lib/timber/version.rb
CHANGED
@@ -43,7 +43,7 @@ if defined?(::ActionController)
|
|
43
43
|
lines = clean_lines(io.string.split("\n"))
|
44
44
|
expect(lines.length).to eq(3)
|
45
45
|
expect(lines[1]).to start_with('Processing by LogSubscriberController#index as HTML\n Parameters: {"query"=>"value"} @metadata {"level":"info","dt":"2016-09-01T12:00:00.000000Z"')
|
46
|
-
expect(lines[1]).to include('"event":{"
|
46
|
+
expect(lines[1]).to include('"event":{"controller_call":{"controller":"LogSubscriberController","action":"index","params_json":"{\"query\":\"value\"}"}}')
|
47
47
|
end
|
48
48
|
|
49
49
|
# Remove blank lines since Rails does this to space out requests in the logs
|
@@ -41,7 +41,7 @@ if defined?(::ActionDispatch)
|
|
41
41
|
lines = clean_lines(io.string.split("\n"))
|
42
42
|
expect(lines.length).to eq(3)
|
43
43
|
expect(lines[2]).to start_with('RuntimeError (boom) @metadata {"level":"fatal",')
|
44
|
-
expect(lines[2]).to include("\"event\":{\"
|
44
|
+
expect(lines[2]).to include("\"event\":{\"exception\":{\"name\":\"RuntimeError\",\"message\":\"boom\",\"backtrace\":[")
|
45
45
|
end
|
46
46
|
|
47
47
|
# Remove blank lines since Rails does this to space out requests in the logs
|
@@ -53,7 +53,7 @@ if defined?(::ActionView)
|
|
53
53
|
dispatch_rails_request("/action_view_log_subscriber")
|
54
54
|
lines = clean_lines(io.string.split("\n"))
|
55
55
|
expect(lines[2].strip).to start_with("Rendered spec/support/rails/templates/template.html (0.0ms) @metadata {\"level\":\"info\"")
|
56
|
-
expect(lines[2]).to include("\"event\":{\"
|
56
|
+
expect(lines[2]).to include("\"event\":{\"template_render\":{\"name\":\"spec/support/rails/templates/template.html\",\"time_ms\":0.0}},")
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -38,7 +38,7 @@ if defined?(::ActiveRecord)
|
|
38
38
|
expect(string).to include("select * from users")
|
39
39
|
expect(string).to include("@metadata")
|
40
40
|
expect(string).to include("\"level\":\"debug\"")
|
41
|
-
expect(string).to include("\"event\":{\"
|
41
|
+
expect(string).to include("\"event\":{\"sql_query\"")
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/spec/timber/logger_spec.rb
CHANGED
@@ -59,7 +59,7 @@ describe Timber::Logger, :rails_23 => true do
|
|
59
59
|
message = Timber::Events::SQLQuery.new(sql: "select * from users", time_ms: 56, message: "select * from users")
|
60
60
|
logger.info(message)
|
61
61
|
expect(io.string).to start_with("select * from users @metadata {\"level\":\"info\",\"dt\":\"2016-09-01T12:00:00.000000Z\",")
|
62
|
-
expect(io.string).to include("\"event\":{\"
|
62
|
+
expect(io.string).to include("\"event\":{\"sql_query\":{\"sql\":\"select * from users\",\"time_ms\":56.0}}")
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should allow :time_ms" 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.19
|
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-
|
11
|
+
date: 2017-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|