tracee 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tracee/logger.rb +1 -1
- data/lib/tracee/preprocessors/formatter.rb +8 -1
- data/lib/tracee/version.rb +1 -1
- data/lib/tracee.rb +1 -0
- 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: 35e807aad5a4029bef68b9dd9e4c979592f63434
|
4
|
+
data.tar.gz: 7d1ea3346537ff05d1691f85c38d19ec21138a5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4dbccd6d9e1aa5617ba0e7563ac018ba20ff00104d34adc0ebaf77bb6aaaccd947f2c1e3cb949d948bf120a5a9a6ef12c9ec70798078e030a89cc0459e574980
|
7
|
+
data.tar.gz: fd607fac145c12014702bacd7d4752ff38e723c1f21c41c5b7eb3f22451c121e794e1c69dcf80022c0f0bbc82ca053a749e965bac1bcc766facd0211c79557fa
|
data/lib/tracee/logger.rb
CHANGED
@@ -17,7 +17,7 @@ module Tracee
|
|
17
17
|
attr_reader :level, :preprocessors, :formatter, :streams
|
18
18
|
|
19
19
|
|
20
|
-
def initialize(stream: $stdout, streams: nil, formatter: {:formatter => :
|
20
|
+
def initialize(stream: $stdout, streams: nil, formatter: {:formatter => :plain}, preprocessors: [], level: :info)
|
21
21
|
@streams = []
|
22
22
|
streams ||= [stream]
|
23
23
|
streams.each {|item| add_stream item}
|
@@ -49,12 +49,19 @@ module Tracee
|
|
49
49
|
if params_or_key.is_a? Symbol
|
50
50
|
params = TEMPLATES[params_or_key]
|
51
51
|
end
|
52
|
+
if params_or_key.is_a? String
|
53
|
+
params = params_or_key
|
54
|
+
end
|
52
55
|
if params.is_a? String
|
53
56
|
params = {summary: params}
|
54
57
|
end
|
58
|
+
if params_or_key.is_a? Hash
|
59
|
+
params = TEMPLATES[params_or_key[:template]] || {}
|
60
|
+
params = params.merge params_or_key
|
61
|
+
end
|
55
62
|
|
56
63
|
unless params.is_a? Hash
|
57
|
-
raise TypeError, '
|
64
|
+
raise TypeError, 'the argument must be a Hash or a reference to one of Tracee::Preprocessors::Formatters::TEMPLATES'
|
58
65
|
end
|
59
66
|
|
60
67
|
@summary, @caller, @datetime, @level = params.values_at(:summary, :caller, :datetime, :level).map &:freeze
|
data/lib/tracee/version.rb
CHANGED
data/lib/tracee.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Baev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|