logatron 0.6.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c259574041bd717713cc48024245476e2b031d8
4
- data.tar.gz: 15d631d11676ec7381334797ca54276b35626406
3
+ metadata.gz: 3103d9cac1561ecd60127ba26110d18fb0fe720e
4
+ data.tar.gz: d35300ec7cdc5165ec570f56faf38fc38436bf25
5
5
  SHA512:
6
- metadata.gz: 9d8baa0917d426963ad34c0811f43b17a2551d3767eff3810cb0492c2becebfeca53cf70ae913ead33d164f955ce2412158578ba72614bbab90b5c98a177039b
7
- data.tar.gz: ef9a5f52803aed7bd9301e8e62bea4a73d157821f15a3f3bb65db1baced02a4c99bfe6ce5dd95425a805de8f8c140a5f7afb4dfa20ceac6f9ea1cff5a3c6ed62
6
+ metadata.gz: 1fb22c5f504469d354b1dd7a0479ef89a45ecadd52d115c553fade502e33babb4b37c4a8eb507edae756fba59f5d0f89e4ecca17cd065e0ca998b3aca2e7b368
7
+ data.tar.gz: d3476f1bde8fd841211d40b37697fe5498733a2cb3132102c3c4e27b8f7bebd83501e0cf53ce86e58a285359005b0b4eb60881ba7d18d992dad088ab04de0f30
data/Gemfile.lock CHANGED
@@ -1,22 +1,23 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- logatron (0.5.0)
4
+ logatron (0.6.0)
5
5
  activesupport (>= 4.2.1, < 6.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (5.0.0.1)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
10
+ activesupport (4.2.7.1)
12
11
  i18n (~> 0.7)
12
+ json (~> 1.7, >= 1.7.7)
13
13
  minitest (~> 5.1)
14
+ thread_safe (~> 0.3, >= 0.3.4)
14
15
  tzinfo (~> 1.1)
15
16
  builder (3.2.2)
16
- concurrent-ruby (1.0.2)
17
17
  diff-lcs (1.2.5)
18
18
  i18n (0.7.0)
19
- minitest (5.9.0)
19
+ json (1.8.3)
20
+ minitest (5.9.1)
20
21
  rake (10.4.2)
21
22
  rspec (3.3.0)
22
23
  rspec-core (~> 3.3.0)
@@ -50,12 +50,27 @@ module Logatron
50
50
  logger.debug(msg)
51
51
  end
52
52
 
53
+ # @deprecated Use operation_context for transportation-layer neutral data.
53
54
  def http_headers
54
55
  {
55
- 'X-Ascent-Log-Id' => msg_id
56
+ 'X-Ascent-Log-Id' => msg_id,
57
+ 'X-Ascent-Site' => site
56
58
  }
57
59
  end
58
60
 
61
+ def operation_context
62
+ {
63
+ message_id: msg_id,
64
+ site: site
65
+ }
66
+ end
67
+
68
+ def operation_context=(info)
69
+ return unless info.is_a? Hash
70
+ self.msg_id = info[:message_id] || info['message_id'] || self.msg_id
71
+ self.site = info[:site] || info['site'] || self.site
72
+ end
73
+
59
74
  def log(id: msg_id, site: Logatron.site, msg: '-', severity: Logatron::INFO, request: '-', status: '-', source: '-', &block)
60
75
  logger.log(id: id, site: site, msg: msg, severity: severity, request: request, status: status, source: source, &block)
61
76
  end
data/logatron.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'logatron/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'logatron'
8
- spec.version = '0.6.0'
8
+ spec.version = '0.7.0'
9
9
  spec.authors = ['Justin Grimes']
10
10
  spec.email = ['justin.mgrimes@gmail.com']
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logatron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Grimes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-23 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport