lumberjack 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/lumberjack/logger.rb +28 -23
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72793f91350cf3b30baede6fb2463d4c3456767445997ea9575a9914e81b5064
|
4
|
+
data.tar.gz: e26eb87f8ce64b37010728c650a3c152ca8e79f068af057f37053aabfdff7e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d432507622e800253e8533f2effa884c00cb890acc4fe94031b5b65c811737f544c1cf6174b90d7dc328e62654a6258e6ebd327a7e5e64a8958484579977c2d3
|
7
|
+
data.tar.gz: af4aee97287aa70c9af2a655ac55ccf38d39a9469d5aedffab3452365b26c89b184fad05a483611b3a500e1af89f1c33b2a23343d70112694f735ae02927189c
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/lib/lumberjack/logger.rb
CHANGED
@@ -156,32 +156,37 @@ module Lumberjack
|
|
156
156
|
# logger.add_entry(:warn, "Request took a long time")
|
157
157
|
# logger.add_entry(Logger::DEBUG){"Start processing with options #{options.inspect}"}
|
158
158
|
def add_entry(severity, message, progname = nil, tags = nil)
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
if
|
174
|
-
tags =
|
159
|
+
begin
|
160
|
+
severity = Severity.label_to_level(severity) unless severity.is_a?(Integer)
|
161
|
+
return true unless device && severity && severity >= level
|
162
|
+
|
163
|
+
return true if Thread.current[:lumberjack_logging]
|
164
|
+
Thread.current[:lumberjack_logging] = true
|
165
|
+
|
166
|
+
time = Time.now
|
167
|
+
message = message.call if message.is_a?(Proc)
|
168
|
+
message = formatter.format(message)
|
169
|
+
progname ||= self.progname
|
170
|
+
|
171
|
+
current_tags = self.tags
|
172
|
+
tags = nil unless tags.is_a?(Hash)
|
173
|
+
if current_tags.empty?
|
174
|
+
tags = Tags.stringify_keys(tags) unless tags.nil?
|
175
175
|
else
|
176
|
-
tags
|
176
|
+
if tags.nil?
|
177
|
+
tags = current_tags.dup
|
178
|
+
else
|
179
|
+
tags = current_tags.merge(Tags.stringify_keys(tags))
|
180
|
+
end
|
177
181
|
end
|
178
|
-
|
179
|
-
|
180
|
-
tags = tag_formatter.format(tags) if tag_formatter
|
181
|
-
|
182
|
-
entry = LogEntry.new(time, severity, message, progname, $$, tags)
|
183
|
-
write_to_device(entry)
|
182
|
+
tags = Tags.expand_runtime_values(tags)
|
183
|
+
tags = tag_formatter.format(tags) if tag_formatter
|
184
184
|
|
185
|
+
entry = LogEntry.new(time, severity, message, progname, $$, tags)
|
186
|
+
write_to_device(entry)
|
187
|
+
ensure
|
188
|
+
Thread.current[:lumberjack_logging] = nil
|
189
|
+
end
|
185
190
|
true
|
186
191
|
end
|
187
192
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumberjack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|