semantic_logger 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/semantic_logger/base.rb +14 -16
- data/lib/semantic_logger/version.rb +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: 24d556e477347252ddf0b9ec58747b066a72d3de
|
4
|
+
data.tar.gz: 4a3ed8b3b1fb893903194cf3ed672a039a974b48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ca1d356e5b4d8d3bcb7d5f71616c0189d0cde904bbea832e0e9ec08d1dc8faad5e367eebe456668fa3c4e1ab5515a9eea8542520acbaad1f4f22bc7e2c520fb
|
7
|
+
data.tar.gz: c0a06161e582b5b979f96c65ac32f7329fe5aa56f714bc6e3da81e19cfb73027ebb0a114d8e8bfd919d0a718308dc45edb98adb28efb3ad80c5b468685d1393b
|
data/lib/semantic_logger/base.rb
CHANGED
@@ -118,23 +118,21 @@ module SemanticLogger
|
|
118
118
|
end_time = Time.now
|
119
119
|
duration = 1000.0 * (end_time - start)
|
120
120
|
|
121
|
-
#
|
122
|
-
if
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
when :partial
|
132
|
-
log Log.new(:#{level}, self.class.thread_name, name, "\#{message} -- Exception: \#{exception.class}: \#{exception.message}", payload, end_time, duration, tags, #{index}, nil)
|
133
|
-
end
|
134
|
-
raise exception
|
135
|
-
else
|
136
|
-
log Log.new(:#{level}, self.class.thread_name, name, message, payload, end_time, duration, tags, #{index}, nil)
|
121
|
+
# Add scoped payload
|
122
|
+
if self.payload
|
123
|
+
payload = payload.nil? ? self.payload : self.payload.merge(payload)
|
124
|
+
end
|
125
|
+
if exception
|
126
|
+
case log_exception
|
127
|
+
when :full
|
128
|
+
log Log.new(:#{level}, self.class.thread_name, name, message, payload, end_time, duration, tags, #{index}, exception)
|
129
|
+
when :partial
|
130
|
+
log Log.new(:#{level}, self.class.thread_name, name, "\#{message} -- Exception: \#{exception.class}: \#{exception.message}", payload, end_time, duration, tags, #{index}, nil)
|
137
131
|
end
|
132
|
+
raise exception
|
133
|
+
elsif duration >= min_duration
|
134
|
+
# Only log if the block took longer than 'min_duration' to complete
|
135
|
+
log Log.new(:#{level}, self.class.thread_name, name, message, payload, end_time, duration, tags, #{index}, nil)
|
138
136
|
end
|
139
137
|
end
|
140
138
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sync_attr
|