zlog 0.9.1 → 0.9.2

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: 55398d282f9e6046be36f6d8536ed4b5758de790
4
- data.tar.gz: 979dd8a9bd1fa1211d895ecf7cec33ca418d2321
3
+ metadata.gz: 8221af279519fb20d8f5a8c60646313a32dc0465
4
+ data.tar.gz: 3214baf78eaed6044728ff4425757f31369cafd1
5
5
  SHA512:
6
- metadata.gz: b3f89f7624fbddb341dc02d25aea5fd0e1368e69c26bca1d93fb7ca56448e4e3b977c51190fe8677814d14ca09bd08af22875f26655e3275248bc41e24b40552
7
- data.tar.gz: dd35a169d8db26157b362547f3893d35ee79bf1fe0245d4fcd9ba328dc74013e5811e82672e90297ab1fd8970b124110df3fddb50e542b168e39c45143bdb0fb
6
+ metadata.gz: 987a8dfc97ddb2846df805c247de4dbe2225570e6d34058e7386d456605656dc1b5aa370a9de8e24a94b243fd96843faf4dbfd57207d881c1420f8eda191f840
7
+ data.tar.gz: 69283e632c9b1f4fce4808f8ab4a170c2bd42bfc39c0666b06b8bb2ee31c1b1d1d3bc80816bbeb4d18fab43eec19ddf8fa0efbd21b3cea20b07d59c7eaef897d
@@ -1,3 +1,7 @@
1
+ ## 0.9.2
2
+
3
+ * bugfix: corrected handling of jsony-messages in cli tool
4
+
1
5
  ## 0.9.1
2
6
 
3
7
  * bugfix: handle multiple log messages in json
@@ -11,7 +11,8 @@ class Zlog::CLI
11
11
  end
12
12
 
13
13
  def convert_line line, opts = {}
14
- Zlog::json_2_event(line).each do |e|
14
+ e = Zlog::json_2_event(line)
15
+ if not e.nil?
15
16
  @layout.format(e)
16
17
  end
17
18
  end
@@ -2,7 +2,7 @@ require 'json'
2
2
  require 'tmpdir'
3
3
 
4
4
  module Zlog
5
- VERSION = "0.9.1"
5
+ VERSION = "0.9.2"
6
6
  extend self
7
7
 
8
8
  def init_stdout opts = {layout: :simple, loglevel: nil}
@@ -60,9 +60,7 @@ module Zlog
60
60
  # json example:
61
61
  # {"timestamp":"2013-10-10T18:37:38.513438+02:00","level":"DEBUG",
62
62
  # "logger":"Log1-debug","message":"debugging info, this won't show up on console"}
63
- Array(j['message']).map do |msg|
64
- Logging::LogEvent.new( j['logger'], Logging.level_num(j['level']), msg, j['timestamp'] )
65
- end
63
+ Logging::LogEvent.new( j['logger'], Logging.level_num(j['level']), j['message'].to_s, j['timestamp'] )
66
64
  rescue
67
65
  nil
68
66
  end
@@ -51,12 +51,10 @@ describe Zlog do
51
51
  it "must convert a logging json to a logevent" do
52
52
  @examples.each do |e|
53
53
  r = Zlog.json_2_event e[:raw]
54
- r.must_be_instance_of Array
55
-
56
- r[0].must_be_instance_of Logging::LogEvent
57
- r[0].level.must_equal e[:level]
58
- r[0].logger.must_equal "Mocker#{e[:name]}"
59
- r[0].data.must_equal "mock message #{e[:name]}"
54
+ r.must_be_instance_of Logging::LogEvent
55
+ r.level.must_equal e[:level]
56
+ r.logger.must_equal "Mocker#{e[:name]}"
57
+ r.data.must_equal "mock message #{e[:name]}"
60
58
  end
61
59
  end
62
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter