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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/zlog/cli.rb +1 -2
- data/lib/zlog/zlog.rb +4 -2
- data/test/classes/zlog_spec.rb +6 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55398d282f9e6046be36f6d8536ed4b5758de790
|
4
|
+
data.tar.gz: 979dd8a9bd1fa1211d895ecf7cec33ca418d2321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f89f7624fbddb341dc02d25aea5fd0e1368e69c26bca1d93fb7ca56448e4e3b977c51190fe8677814d14ca09bd08af22875f26655e3275248bc41e24b40552
|
7
|
+
data.tar.gz: dd35a169d8db26157b362547f3893d35ee79bf1fe0245d4fcd9ba328dc74013e5811e82672e90297ab1fd8970b124110df3fddb50e542b168e39c45143bdb0fb
|
data/CHANGELOG.md
CHANGED
data/lib/zlog/cli.rb
CHANGED
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.
|
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
|
-
|
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
|
data/test/classes/zlog_spec.rb
CHANGED
@@ -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
|
55
|
-
|
56
|
-
r.
|
57
|
-
r.
|
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.
|
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-
|
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:
|