tracee 1.0.19 → 1.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tracee.rb +4 -1
- data/lib/tracee/ext/object.rb +3 -1
- data/lib/tracee/logger.rb +12 -1
- data/lib/tracee/version.rb +1 -1
- 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: 557a7f67084c24ccd0866a9f586ec1ff803aae98
|
4
|
+
data.tar.gz: e4594457cab31e45f1d31b6f079bf52a0f8e8969
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50641413455386a05c5ae3e9d69b7705e02704b66ed8e41a67670e5d455653514d5872aec0e266dc724bae9aa35c7c3d7ae541506081ca7fae84d6dc157dc28
|
7
|
+
data.tar.gz: 7aaf0979f7f73e3e5371acfb41dcb489508249cfa7ef5faa00d1a80b99b9e7eccc48b928ae42d7ac328d47f11e7b63a6cb5dbf89db43c3aef25310f97c5d092c
|
data/lib/tracee.rb
CHANGED
@@ -51,6 +51,9 @@ module Tracee
|
|
51
51
|
mattr_accessor :better_errors_quiet_backtraces
|
52
52
|
self.better_errors_quiet_backtraces = true
|
53
53
|
|
54
|
+
# Default logger to respond to Object#__log__
|
55
|
+
mattr_accessor :default_logger
|
56
|
+
|
54
57
|
# In order to use Tracee's trace decorator with BetterErrors, Tracee must be loaded prior to BetterErrros.
|
55
58
|
if defined? ::BetterErrors::ExceptionExtension
|
56
59
|
# BetterErrors was loaded and BetterErrors::ExceptionExtension was prepended to Exception.
|
@@ -112,5 +115,5 @@ module Tracee
|
|
112
115
|
end
|
113
116
|
|
114
117
|
|
115
|
-
$log ||= Logger.new
|
118
|
+
$log ||= Logger.new default: true
|
116
119
|
end
|
data/lib/tracee/ext/object.rb
CHANGED
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: {:default => :plain}, preprocessors: [], level: :info)
|
20
|
+
def initialize(stream: $stdout, streams: nil, formatter: {:default => :plain}, preprocessors: [], level: :info, default: false)
|
21
21
|
@streams = []
|
22
22
|
streams ||= [stream]
|
23
23
|
streams.each {|item| add_stream item}
|
@@ -40,6 +40,13 @@ module Tracee
|
|
40
40
|
|
41
41
|
self.level = level
|
42
42
|
read_log_level_from_env
|
43
|
+
|
44
|
+
if default
|
45
|
+
if Tracee.default_logger
|
46
|
+
warn "Overwriting default logger #{Tracee.default_logger}\nwith the new one: #{self}"
|
47
|
+
end
|
48
|
+
Tracee.default_logger = self
|
49
|
+
end
|
43
50
|
end
|
44
51
|
|
45
52
|
|
@@ -175,6 +182,10 @@ module Tracee
|
|
175
182
|
end
|
176
183
|
end
|
177
184
|
|
185
|
+
def default?
|
186
|
+
Tracee.default_logger.eql? self
|
187
|
+
end
|
188
|
+
|
178
189
|
private
|
179
190
|
|
180
191
|
def norm_level(level)
|
data/lib/tracee/version.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.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Baev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|