debug_logging 1.0.3 → 1.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89562d2a89d0557af4167d7e841249dde4d5746c
|
4
|
+
data.tar.gz: 25d727905d37ef09e9b395a9cc25197d087231a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3763c0fbd62d426dc031aa6b3a29ba9a6812387570a0ac3f3ce619cb658244d5bfee08545508458c35b2b26d5032d817370d739ddc2f7358f783d114981fcafc
|
7
|
+
data.tar.gz: 0c19c2632702184658565f33a5af035edc796967d0d920c1a86cf36fad8de18787029b7bbc489275bf91ab3651bca93a795c224e9140d1537c1084508681d09b
|
@@ -7,7 +7,7 @@ module DebugLogging
|
|
7
7
|
def included(base)
|
8
8
|
return unless @instance_methods_to_log
|
9
9
|
base.send(:include, ArgumentPrinter)
|
10
|
-
instance_method_logger = DebugLogging::InstanceLoggerModulizer.to_mod(methods_to_log: @instance_methods_to_log,
|
10
|
+
instance_method_logger = DebugLogging::InstanceLoggerModulizer.to_mod(methods_to_log: @instance_methods_to_log, config: @config)
|
11
11
|
base.send(:prepend, instance_method_logger)
|
12
12
|
end
|
13
13
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
module DebugLogging
|
2
2
|
module InstanceLoggerModulizer
|
3
|
-
def self.to_mod(methods_to_log: nil,
|
3
|
+
def self.to_mod(methods_to_log: nil, config: nil)
|
4
4
|
Module.new do
|
5
5
|
Array(methods_to_log).each do |method_to_log|
|
6
6
|
# method name must be a symbol
|
7
7
|
define_method(method_to_log.to_sym) do |*args, &block|
|
8
8
|
config_proxy = if config_proxy.is_a?(Hash)
|
9
|
-
Configuration.new(**(self.class.debug_config.to_hash.merge(
|
9
|
+
Configuration.new(**(self.class.debug_config.to_hash.merge(config)))
|
10
10
|
else
|
11
11
|
self.class
|
12
12
|
end
|