debug_logging 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3175dd95278445508de7ab86b58993c7758777a9
4
- data.tar.gz: 2f63b6b6728dbd590fe43f099c4ca0076ebc90de
3
+ metadata.gz: d1f649cd850c423d03edf55069507edd87de757c
4
+ data.tar.gz: ec73842ae01f51363abcd1b2ea3ae5e7bb0e46c7
5
5
  SHA512:
6
- metadata.gz: 7044a9f9f938a180fd8284c665f0d5dc3d4cbd0f61cc7f92e91803cc7bb9cdc024d759981866c15269d098f1065b217dd44c529dee52cb43a219d291cb0376d6
7
- data.tar.gz: a842c4d45b4a5ab522776841a07ff29c0a8569733bbc7640871df496e5ba3ae38994fde4324d5f915ceabc0f02f5422d07c04f30c8ea96b459de974982f1f387
6
+ metadata.gz: 606f5c37a217527ecf393aa6478913b5e0c3450ba36239e12cba60bb0e9a75655215dd8097df9160d5be1facd00a446cee0cde9206c51f5afefedcb63293a36b
7
+ data.tar.gz: f458095783046eecee743147580fcafd1dcb6b73ae6c930d2dffba928fcf5e0e06fad030bfc3b0c1738e9cd26bb7abac541422a037e8f075247d542823a49260
@@ -59,8 +59,9 @@ module DebugLogging
59
59
  end
60
60
 
61
61
  #### API ####
62
- def debug_log(message)
63
- debug_logger.send(debug_log_level, message)
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 "#{log_prefix}#{signature}#{invocation_id}"
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 "#{log_prefix} #{debug_benchmark_to_s(tms: tms)}#{invocation_id}"
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 "#{log_prefix}#{signature}#{invocation_id}"
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 "#{log_prefix} #{self.class.debug_benchmark_to_s(tms: tms)}#{invocation_id}"
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
@@ -1,3 +1,3 @@
1
1
  module DebugLogging
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  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.2
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-30 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize