rt-logman 1.2.0 → 1.3.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 +17 -4
- 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: 3a98a531ba1b21899c6947970888715617f6d70f
|
4
|
+
data.tar.gz: fec8d1f4f2428bbc744f00f57a462b098bfdb22e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f9caae8bc668a56c413b4612f889a2b752d57c1163f682610bb5e66c1f5cc933abb01da95af7a5f05b36db367d0462a66914c0aa86ba2b7e9f54dc69f2eb752
|
7
|
+
data.tar.gz: c7a47680c2c7e24fdce6b4d961cd35d9a2a68c2ab01843fb6b86f58f0384f397ddf545927099b2485fda1320a5cd58db903b3c989de272270f366f4f3df5e3c8
|
data/Gemfile.lock
CHANGED
data/lib/logman.rb
CHANGED
@@ -74,15 +74,28 @@ class Logman
|
|
74
74
|
private
|
75
75
|
|
76
76
|
def log(level, message, metadata = {})
|
77
|
-
|
78
|
-
|
79
|
-
@logger.public_send(level, "#{message} -- #{meta}")
|
77
|
+
@logger.public_send(level, { :msg => message }.merge(@fields).merge(metadata))
|
80
78
|
end
|
81
79
|
|
82
80
|
def formatter
|
83
81
|
proc do |severity, datetime, _progname, msg|
|
84
|
-
|
82
|
+
event = {
|
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"
|
85
95
|
end
|
86
96
|
end
|
87
97
|
|
98
|
+
def format(event_hash)
|
99
|
+
event_hash.to_json
|
100
|
+
end
|
88
101
|
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.3.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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|