zlog 0.9.0 → 0.9.1

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: 83d95585a76db78691e020e75f4c140ef0805b1c
4
- data.tar.gz: e917eab598ba75a5f2f38132e09bd3d674dac559
3
+ metadata.gz: 55398d282f9e6046be36f6d8536ed4b5758de790
4
+ data.tar.gz: 979dd8a9bd1fa1211d895ecf7cec33ca418d2321
5
5
  SHA512:
6
- metadata.gz: 4338fd423d4fbeff430fce51a5220dd58b2251eab0be9488a2dacb480ff17dd6c2a2cd0eb538abf72a7dc554de6aed56315ca0803b66351f37ad07eaf7713eb4
7
- data.tar.gz: b5e9b5996f987a69762c1f8c097017294014702ea8b4f7deeb72a0dbdc9ea321b2d019b11e3bfd2ffdbed09efc94ee25f47c39f8c83a26e0d97841105d7168f6
6
+ metadata.gz: b3f89f7624fbddb341dc02d25aea5fd0e1368e69c26bca1d93fb7ca56448e4e3b977c51190fe8677814d14ca09bd08af22875f26655e3275248bc41e24b40552
7
+ data.tar.gz: dd35a169d8db26157b362547f3893d35ee79bf1fe0245d4fcd9ba328dc74013e5811e82672e90297ab1fd8970b124110df3fddb50e542b168e39c45143bdb0fb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.9.1
2
+
3
+ * bugfix: handle multiple log messages in json
4
+
1
5
  ## 0.9.0
2
6
 
3
7
  * bugfix: allow continuous readinf from stdin, without waiting for eof
data/lib/zlog/cli.rb CHANGED
@@ -11,8 +11,7 @@ class Zlog::CLI
11
11
  end
12
12
 
13
13
  def convert_line line, opts = {}
14
- e = Zlog::json_2_event(line)
15
- if not e.nil?
14
+ Zlog::json_2_event(line).each do |e|
16
15
  @layout.format(e)
17
16
  end
18
17
  end
data/lib/zlog/zlog.rb CHANGED
@@ -2,7 +2,7 @@ require 'json'
2
2
  require 'tmpdir'
3
3
 
4
4
  module Zlog
5
- VERSION = "0.9.0"
5
+ VERSION = "0.9.1"
6
6
  extend self
7
7
 
8
8
  def init_stdout opts = {layout: :simple, loglevel: nil}
@@ -60,7 +60,9 @@ 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
- Logging::LogEvent.new( j['logger'], Logging.level_num(j['level']), j['message'], j['timestamp'] )
63
+ Array(j['message']).map do |msg|
64
+ Logging::LogEvent.new( j['logger'], Logging.level_num(j['level']), msg, j['timestamp'] )
65
+ end
64
66
  rescue
65
67
  nil
66
68
  end
@@ -51,10 +51,12 @@ 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 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]}"
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]}"
58
60
  end
59
61
  end
60
62
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -80,3 +80,4 @@ signing_key:
80
80
  specification_version: 4
81
81
  summary: rudimentary simple logging for ruby
82
82
  test_files: []
83
+ has_rdoc: