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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1cbf6e1fada619873ed59f75deef55f365a3dae
4
- data.tar.gz: 38abf4a05950039c65fc11c4ba52f803fed71085
3
+ metadata.gz: 2e4d4e220779ebe8ea442c98c2f03f36cf12f438
4
+ data.tar.gz: e995c553745a8839d306eea480d359063a779b9c
5
5
  SHA512:
6
- metadata.gz: b9457963527f193130bbe8262b62d40ee0b3f917fe4c61a4e18cf2c1a3b733cc8187ab4dbaf5792080c078e7184472a744ec7190510ee875ee6bc51ba5c64008
7
- data.tar.gz: 47e70a59700fcd56171f3b38e6996cbd6d7a0e5b28feaf8baae530206a114823e1ff84dfd7ed58c10f4f37ec542e679093e8aae75c3c9a13588ae207001864cf
6
+ metadata.gz: ca96f8e714fef59f4a14155b0376094928171636f2ca4cbb372ef928112d5e4c9c1f4be40c2cb856f94568d4139066e95d4544380fa043540c831a138f06a5d0
7
+ data.tar.gz: 41e76ccddb69c9961330560d78c9d82d941e2af0ad91e6e506ae99628147ea3ff96f43c9979299fdaa84b3638adaf88512e1e1532f11c7b33aae8a5287853031
@@ -24,7 +24,7 @@ module Timber
24
24
  alias to_h to_hash
25
25
 
26
26
  def as_json(_options = {})
27
- {:server_side_app => {:controller_call => to_hash}}
27
+ {:controller_call => to_hash}
28
28
  end
29
29
 
30
30
  def message
@@ -26,7 +26,7 @@ module Timber
26
26
  alias to_h to_hash
27
27
 
28
28
  def as_json(_options = {})
29
- {:server_side_app => {:exception => to_hash}}
29
+ {:exception => to_hash}
30
30
  end
31
31
 
32
32
  def message
@@ -31,7 +31,7 @@ module Timber
31
31
  alias to_h to_hash
32
32
 
33
33
  def as_json(_options = {})
34
- {:server_side_app => {:http_client_request => to_hash}}
34
+ {:http_client_request => to_hash}
35
35
  end
36
36
 
37
37
  def message
@@ -26,7 +26,7 @@ module Timber
26
26
  alias to_h to_hash
27
27
 
28
28
  def as_json(_options = {})
29
- {:server_side_app => {:http_client_response => to_hash}}
29
+ {:http_client_response => to_hash}
30
30
  end
31
31
 
32
32
  def message
@@ -27,7 +27,7 @@ module Timber
27
27
  alias to_h to_hash
28
28
 
29
29
  def as_json(_options = {})
30
- {:server_side_app => {:http_server_request => to_hash}}
30
+ {:http_server_request => to_hash}
31
31
  end
32
32
 
33
33
  def message
@@ -22,7 +22,7 @@ module Timber
22
22
  alias to_h to_hash
23
23
 
24
24
  def as_json(_options = {})
25
- {:server_side_app => {:http_server_response => to_hash}}
25
+ {:http_server_response => to_hash}
26
26
  end
27
27
 
28
28
  def message
@@ -20,7 +20,7 @@ module Timber
20
20
  alias to_h to_hash
21
21
 
22
22
  def as_json(_options = {})
23
- {:server_side_app => {:sql_query => to_hash}}
23
+ {:sql_query => to_hash}
24
24
  end
25
25
  end
26
26
  end
@@ -20,7 +20,7 @@ module Timber
20
20
  alias to_h to_hash
21
21
 
22
22
  def as_json(_options = {})
23
- {:server_side_app => {:template_render => to_hash}}
23
+ {:template_render => to_hash}
24
24
  end
25
25
  end
26
26
  end
@@ -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
@@ -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/1.2.21/schema.json".freeze
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
 
@@ -1,3 +1,3 @@
1
1
  module Timber
2
- VERSION = "2.0.17"
2
+ VERSION = "2.0.19"
3
3
  end
@@ -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":{"server_side_app":{"controller_call":{"controller":"LogSubscriberController","action":"index","params_json":"{\"query\":\"value\"}"}}}')
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\":{\"server_side_app\":{\"exception\":{\"name\":\"RuntimeError\",\"message\":\"boom\",\"backtrace\":[")
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\":{\"server_side_app\":{\"template_render\":{\"name\":\"spec/support/rails/templates/template.html\",\"time_ms\":0.0}}},")
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\":{\"server_side_app\":{\"sql_query\"")
41
+ expect(string).to include("\"event\":{\"sql_query\"")
42
42
  end
43
43
  end
44
44
  end
@@ -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\":{\"server_side_app\":{\"sql_query\":{\"sql\":\"select * from users\",\"time_ms\":56.0}}}")
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.17
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-04-23 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack