threaded_logging 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/threaded_logging.rb +3 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43c5a2fcc786291de3cfbe4f27daf182d720dcfe
|
4
|
+
data.tar.gz: 3bf35551662d69cc088fc7084aa759aa549c7ffc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5d8f8841d46b9d15fbd7eb108a58e458c6d567b7258de6c66328fd37ab933524ea3989e39f4614e16deeacb082b65d440d0c3169cb220db35216bfd099c6418
|
7
|
+
data.tar.gz: 8a6bc21b4129c5f2e3a8bcf3b7bfefb90e9b31c545a7cdca4dfee445aef6123f6a02e2172148676a558b59b9a8475735cf06ebfb98bec9b53a079d9dead484ba
|
data/lib/threaded_logging.rb
CHANGED
@@ -2,12 +2,13 @@ require "English"
|
|
2
2
|
|
3
3
|
module ThreadedLogging
|
4
4
|
def call(severity, time, _progname, msg)
|
5
|
-
time_string = time.strftime("%Y-%m-%dT%H:%M:%S
|
5
|
+
time_string = time.strftime("%Y-%m-%dT%H:%M:%S.%6N")
|
6
6
|
thread_id = Digest::MD5.hexdigest([Thread.current.object_id, $PID].join)[0...8]
|
7
7
|
|
8
8
|
metadata = "#{severity[0]} [#{time_string}] ##{thread_id}:"
|
9
|
+
|
9
10
|
message = ""
|
10
|
-
msg.lines.each { |line| message << "#{metadata} #{line}" }
|
11
|
+
msg.to_s.lines.each { |line| message << "#{metadata} #{line}" }
|
11
12
|
"#{message}\n"
|
12
13
|
end
|
13
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: threaded_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
@@ -37,9 +37,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
39
|
rubyforge_project:
|
40
|
-
rubygems_version: 2.
|
40
|
+
rubygems_version: 2.6.7
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
|
-
summary: Better formatter for
|
43
|
+
summary: Better formatter for ruby loggers
|
44
44
|
test_files: []
|
45
|
-
has_rdoc:
|