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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7271591545c3b1459481925cd6affa68f0cb4657
4
- data.tar.gz: 8f931c372871a15c87e4d0df88ce38dde4995e3a
3
+ metadata.gz: 35e807aad5a4029bef68b9dd9e4c979592f63434
4
+ data.tar.gz: 7d1ea3346537ff05d1691f85c38d19ec21138a5f
5
5
  SHA512:
6
- metadata.gz: 1121fcb4f4e0950d9aae02900afce4351cbe59ada5d1a2212e0020f78a5ca6c7a644b71c01a16e1c8ef539030c31e5c94d3323833c93e1ce284ed9f9a26d990f
7
- data.tar.gz: ae5cd83d8c372777d7126c60ec8f891bf51d6937a0d67b483e482695ddab65aa33bf6176f6eb674b38d766462c68745747e05f75cffc056429565e8ede43556b
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 => :tracee}, preprocessors: [], level: :info)
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, 'params must be a Hash or a reference to one of Tracee::Formatters::Template::TEMPLATES'
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
@@ -1,3 +1,3 @@
1
1
  module Tracee
2
- VERSION = "1.0.10"
2
+ VERSION = "1.0.11"
3
3
  end
data/lib/tracee.rb CHANGED
@@ -57,6 +57,7 @@ module Tracee
57
57
  ::Exception.send :class_attribute, :trace_decorator
58
58
 
59
59
 
60
+ # Doesn't work with Rails 5+
60
61
  module ::ActiveSupport::TaggedLogging::Formatter
61
62
  include Tracee::Extensions::ActiveSupport::TaggedLogging::Formatter
62
63
  end
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.10
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: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler