quandl_logger 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/quandl/logger/version.rb +1 -1
- data/lib/quandl/logger.rb +7 -0
- metadata +1 -1
data/lib/quandl/logger.rb
CHANGED
@@ -21,6 +21,13 @@ module Quandl
|
|
21
21
|
@@logger if defined?(@@logger)
|
22
22
|
end
|
23
23
|
|
24
|
+
def info_with_elapsed(message=nil, &block)
|
25
|
+
timer = Time.now
|
26
|
+
result = block.call
|
27
|
+
info("#{message} (#{timer.elapsed.microseconds}ms)")
|
28
|
+
result
|
29
|
+
end
|
30
|
+
|
24
31
|
def use(log_file)
|
25
32
|
log_file = ::Logger.new(log_file) if log_file.is_a?(String)
|
26
33
|
@@logger = log_file
|