debug_logging 1.0.2 → 1.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1f649cd850c423d03edf55069507edd87de757c
|
4
|
+
data.tar.gz: ec73842ae01f51363abcd1b2ea3ae5e7bb0e46c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 606f5c37a217527ecf393aa6478913b5e0c3450ba36239e12cba60bb0e9a75655215dd8097df9160d5be1facd00a446cee0cde9206c51f5afefedcb63293a36b
|
7
|
+
data.tar.gz: f458095783046eecee743147580fcafd1dcb6b73ae6c930d2dffba928fcf5e0e06fad030bfc3b0c1738e9cd26bb7abac541422a037e8f075247d542823a49260
|
data/lib/debug_logging.rb
CHANGED
@@ -59,8 +59,9 @@ module DebugLogging
|
|
59
59
|
end
|
60
60
|
|
61
61
|
#### API ####
|
62
|
-
def debug_log(message)
|
63
|
-
|
62
|
+
def debug_log(message, config_proxy = nil)
|
63
|
+
config_proxy ||= self
|
64
|
+
config_proxy.debug_logger.send(config_proxy.debug_log_level, message)
|
64
65
|
end
|
65
66
|
|
66
67
|
# There are times when the class will need access to the configuration object,
|
@@ -22,12 +22,12 @@ module DebugLogging
|
|
22
22
|
log_prefix = debug_invocation_to_s(klass: self.to_s, separator: ".", method_to_log: method_to_log, config_proxy: config_proxy)
|
23
23
|
signature = debug_signature_to_s(args: args, config_proxy: config_proxy)
|
24
24
|
invocation_id = debug_invocation_id_to_s(args: args, config_proxy: config_proxy)
|
25
|
-
debug_log
|
25
|
+
debug_log("#{log_prefix}#{signature}#{invocation_id}", config_proxy)
|
26
26
|
if config_proxy.debug_class_benchmarks
|
27
27
|
tms = Benchmark.measure do
|
28
28
|
method_return_value = original_method.call(*args, &block)
|
29
29
|
end
|
30
|
-
debug_log
|
30
|
+
debug_log("#{log_prefix} #{debug_benchmark_to_s(tms: tms)}#{invocation_id}", config_proxy)
|
31
31
|
else
|
32
32
|
method_return_value = original_method.call(*args, &block)
|
33
33
|
end
|
@@ -14,12 +14,12 @@ module DebugLogging
|
|
14
14
|
log_prefix = self.class.debug_invocation_to_s(klass: self.class.to_s, separator: "#", method_to_log: method_to_log, config_proxy: config_proxy)
|
15
15
|
signature = self.class.debug_signature_to_s(args: args, config_proxy: config_proxy)
|
16
16
|
invocation_id = self.class.debug_invocation_id_to_s(args: args, config_proxy: config_proxy)
|
17
|
-
self.class.debug_log
|
17
|
+
self.class.debug_log("#{log_prefix}#{signature}#{invocation_id}", config_proxy)
|
18
18
|
if config_proxy.debug_instance_benchmarks
|
19
19
|
tms = Benchmark.measure do
|
20
20
|
method_return_value = super(*args, &block)
|
21
21
|
end
|
22
|
-
self.class.debug_log
|
22
|
+
self.class.debug_log("#{log_prefix} #{self.class.debug_benchmark_to_s(tms: tms)}#{invocation_id}", config_proxy)
|
23
23
|
else
|
24
24
|
method_return_value = super(*args, &block)
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debug_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|