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 +4 -4
- data/lib/simple_structured_logger.rb +7 -2
- data/simple_structured_logger.gemspec +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: 589f9bda3c263ec3e42567e925529318fd71e332
|
4
|
+
data.tar.gz: d3480fb74a2e6f10009f59208cec5d6db058951e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|