contextual_logger 0.9.0.pre.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contextual_logger.rb +5 -3
- data/lib/contextual_logger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f52753d4acdf8c75e8c94154a8002490e88ccc0201bf6623d6b47a2c65791f
|
4
|
+
data.tar.gz: 304de20b917e9c4078dc83ce96867f44af03d9adbf95e18091e3987e17cabcaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b3e5489d812a5dc8885a43f92d631a3d99ce3d1a5f7cb631ed16b2457cc2793f4c9ec72d91c09121db047cb83eac3f807db2a722e2481bfc4a39cf85cd12970
|
7
|
+
data.tar.gz: 78e344d513e2c04ccfa545cc492a514af7d90bf06c335ee80629c10be87339db3004e3fa9d9c801c327d3b4af6af7eec48ece482e05519da7b55cd1a052bd480
|
data/lib/contextual_logger.rb
CHANGED
@@ -136,18 +136,20 @@ module ContextualLogger
|
|
136
136
|
if @formatter
|
137
137
|
@formatter.call(severity, timestamp, progname, { message: ContextualLogger.normalize_message(message), **context })
|
138
138
|
else
|
139
|
-
"#{
|
139
|
+
"#{basic_json_log_entry(severity, timestamp, progname, message, context: context)}\n"
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
143
|
-
def
|
143
|
+
def basic_json_log_entry(severity, timestamp, progname, message, context:)
|
144
144
|
message_hash = {
|
145
145
|
message: ContextualLogger.normalize_message(message),
|
146
146
|
severity: severity,
|
147
147
|
timestamp: timestamp
|
148
148
|
}
|
149
149
|
message_hash[:progname] = progname if progname
|
150
|
-
|
150
|
+
|
151
|
+
# using merge! instead of merge for speed of operation
|
152
|
+
message_hash.merge!(context).to_json
|
151
153
|
end
|
152
154
|
end
|
153
155
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contextual_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Ebentier
|
@@ -67,9 +67,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- - "
|
70
|
+
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
72
|
+
version: '0'
|
73
73
|
requirements: []
|
74
74
|
rubygems_version: 3.0.3
|
75
75
|
signing_key:
|