rt-logman 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/logman.rb +4 -17
- data/lib/logman/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: cc85961093fc227f2cfff8571bd009840407a1d2
|
4
|
+
data.tar.gz: 4d5d185920f6d15bd3cc7d863d1d1d3aae20a748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b03e92623808049925fafd3a353fe8bc4574401489105a1d7af1203417c8e6b2962b2b052b777cc0ef6ac32f10d6f06127fac07eb18813d097552e45eea961b
|
7
|
+
data.tar.gz: aa14f92a9a4c7d07865ed318bf89e27dc0dfba0ff9e0ccdfed58adb44f304a31affc0b7074c302bbf07347cac37fea7770204d5c7d70ad0e2ff7acad95d481db
|
data/Gemfile.lock
CHANGED
data/lib/logman.rb
CHANGED
@@ -74,28 +74,15 @@ class Logman
|
|
74
74
|
private
|
75
75
|
|
76
76
|
def log(level, message, metadata = {})
|
77
|
-
@
|
77
|
+
meta = @fields.merge(metadata).map { |key, val| "#{key}: '#{val}'" }.join(", ")
|
78
|
+
|
79
|
+
@logger.public_send(level, "#{message} -- #{meta}")
|
78
80
|
end
|
79
81
|
|
80
82
|
def formatter
|
81
83
|
proc do |severity, datetime, _progname, msg|
|
82
|
-
|
83
|
-
:level => severity.upcase,
|
84
|
-
:time => datetime,
|
85
|
-
:pid => Process.pid
|
86
|
-
}
|
87
|
-
|
88
|
-
if msg.is_a?(Hash)
|
89
|
-
event.merge!(msg)
|
90
|
-
else
|
91
|
-
event[:msg] = msg.to_s
|
92
|
-
end
|
93
|
-
|
94
|
-
"#{format(event)}\n"
|
84
|
+
"#{severity.upcase} [#{datetime.strftime("%H:%M:%S.%3N")} ##{Process.pid}] -- #{msg}\n"
|
95
85
|
end
|
96
86
|
end
|
97
87
|
|
98
|
-
def format(event_hash)
|
99
|
-
event_hash.to_json
|
100
|
-
end
|
101
88
|
end
|
data/lib/logman/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rt-logman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rendered Text
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|