simple_structured_logger 0.1.1 → 0.1.2

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: a8498040cf62d3631a92a8bd9d426b9fec6bee7f
4
- data.tar.gz: 7e0b4c60ecba55c5de25f029f6269739e02558cf
3
+ metadata.gz: 589f9bda3c263ec3e42567e925529318fd71e332
4
+ data.tar.gz: d3480fb74a2e6f10009f59208cec5d6db058951e
5
5
  SHA512:
6
- metadata.gz: f3f47417fcd7dbdf6693b9aee4fc1dcca3cf3ebbfb7af79ba636e80bc3a19a57d267ba36033ca3c5e42debcb5af48b3059755142accf3b8dda82492e8168990e
7
- data.tar.gz: 724febfcbfd7cad5cfa2814a28eb798979cb61c1c474deebbbd4321d684c12bf180bbbc709215486e6ddb4feff9dc802e81cb6c47953966f8e92ed6a40440cf5
6
+ metadata.gz: 305f9cfe633f42846f5c456558008a8a5faf16e68ea66956070f45f6f6cfa1f02ad9c13421efe41900914f45e3ba40cc37d9361f22f196637541666bb3317fe5
7
+ data.tar.gz: c32ac9424086c6cacaa1b2d128edfd07a4eb67d5c917616267faf458a08d652f8070e332f1f5f250c1ebab00317812d36eb4c76d70e197895af676effcbf8171
@@ -7,7 +7,6 @@ module SimpleStructuredLogger
7
7
  end
8
8
 
9
9
  def self.included(klass)
10
-
11
10
  # TODO there's got to be a cleaner way to add a class method from `include`
12
11
  klass.class_eval do
13
12
  def self.log
@@ -54,6 +53,10 @@ module SimpleStructuredLogger
54
53
  def set_context(context)
55
54
  reset_context!
56
55
 
56
+ if self.respond_to?(:expand_context)
57
+ context = self.expand_context(context)
58
+ end
59
+
57
60
  @default_tags.merge!(context)
58
61
  end
59
62
 
@@ -78,7 +81,9 @@ module SimpleStructuredLogger
78
81
  def stringify_tags(additional_tags)
79
82
  additional_tags = additional_tags.dup
80
83
 
81
- # TODO expand
84
+ if self.respond_to?(:expand_log)
85
+ additional_tags = self.expand_log(additional_tags)
86
+ end
82
87
 
83
88
  @default_tags.merge(additional_tags).map { |k,v| "#{k}=#{v}" }.join(' ')
84
89
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "simple_structured_logger"
7
- spec.version = '0.1.1'
7
+ spec.version = '0.1.2'
8
8
  spec.authors = ["Michael Bianco"]
9
9
  spec.email = ["mike@cliffsidemedia.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_structured_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bianco
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler