smart_logger_wrapper 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smart_logger_wrapper/version.rb +1 -1
- data/lib/smart_logger_wrapper.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f193215b0f2007b0861602a5169acd5b6f4fe8a2
|
4
|
+
data.tar.gz: c6a426240e52e5f6d24fbfbe9151288f19115b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4545b47f0bc02df95cbc5699ae8243990851b894fd17569705b31d2a0369d95f0a6c02603f9e61c7ba3a5eb5dc3d85ace00b700e23aab555ac87a5352a623e86
|
7
|
+
data.tar.gz: 45f5c6e4014e62913bba562bc61ed4b6da304ca091c53f0d08dbd274bf8f780a782c03917868a405849e4f4ec02b539dd0dcd8fa5ad0b8445a51dbc105426dff
|
data/lib/smart_logger_wrapper.rb
CHANGED
@@ -73,15 +73,16 @@ class SmartLoggerWrapper
|
|
73
73
|
|
74
74
|
def method_missing(method_name, *args, &block)
|
75
75
|
if Options.defined_option?(method_name)
|
76
|
-
#
|
76
|
+
# If there is an defined option with the same name as the method name, return a new logger with the option.
|
77
77
|
new_logger = self.class.new(*loggers, **options.merge(method_name => args.first))
|
78
78
|
return block.(new_logger) if block_given?
|
79
79
|
new_logger
|
80
80
|
else
|
81
|
-
#
|
82
|
-
|
81
|
+
# Otherwise, call the method of the warpped logger.
|
82
|
+
# The reutrn value is that of the first one.
|
83
|
+
loggers.map do |logger|
|
83
84
|
logger.public_send(method_name, *args, &block)
|
84
|
-
end
|
85
|
+
end.first
|
85
86
|
end
|
86
87
|
end
|
87
88
|
end
|