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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 394f206c5580b238f08fdada399581b8b049d5a3
4
- data.tar.gz: 435080f3efc32a2070d47e0bb1355f45e3e6ce56
3
+ metadata.gz: cc85961093fc227f2cfff8571bd009840407a1d2
4
+ data.tar.gz: 4d5d185920f6d15bd3cc7d863d1d1d3aae20a748
5
5
  SHA512:
6
- metadata.gz: 5dcf78191f48fdd410b7bfb11be9d6eaa898dd9163876aa0c5672637bfa4cd59aa285f40a17ea02d13e76cb4d29976671a6940d182151c29c9a270002406f288
7
- data.tar.gz: 52c8a85c339ff56d36142d95088b31ff4fde975b6c22a596d11ca36e72c3b29fd34fbca8cc68de8361569eba3696e60c2cca3f5b57e4d05687eb2194ccbbdf5c
6
+ metadata.gz: 0b03e92623808049925fafd3a353fe8bc4574401489105a1d7af1203417c8e6b2962b2b052b777cc0ef6ac32f10d6f06127fac07eb18813d097552e45eea961b
7
+ data.tar.gz: aa14f92a9a4c7d07865ed318bf89e27dc0dfba0ff9e0ccdfed58adb44f304a31affc0b7074c302bbf07347cac37fea7770204d5c7d70ad0e2ff7acad95d481db
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rt-logman (1.1.0)
4
+ rt-logman (1.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -74,28 +74,15 @@ class Logman
74
74
  private
75
75
 
76
76
  def log(level, message, metadata = {})
77
- @logger.public_send(level, { :msg => message }.merge(@fields).merge(metadata))
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
- 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"
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
@@ -1,3 +1,3 @@
1
1
  class Logman
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
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.1.0
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-13 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler