Module: Contrast::Logger::Time
- Defined in:
- lib/contrast/logger/time.rb
Overview
Our decorator for the Ougai logger allowing for timing and with_level methods.
Instance Method Summary collapse
-
#debug_with_time(*msgs, &block) ⇒ Object
Log, at the debug level, the action with a message including the time it took for the wrapped function to complete.
-
#trace_with_time(*msgs, &block) ⇒ Object
Log, at the trace level, the action with a message including the time it took for the wrapped function to complete.
-
#with_level(level, message) ⇒ Object
Log the message at the given level.
Instance Method Details
#debug_with_time(*msgs, &block) ⇒ Object
Log, at the debug level, the action with a message including the time it took for the wrapped function to complete.
24 25 26 |
# File 'lib/contrast/logger/time.rb', line 24 def debug_with_time *msgs, &block log_with_time(:debug, *msgs, &block) end |
#trace_with_time(*msgs, &block) ⇒ Object
Log, at the trace level, the action with a message including the time it took for the wrapped function to complete.
34 35 36 |
# File 'lib/contrast/logger/time.rb', line 34 def trace_with_time *msgs, &block log_with_time(:trace, *msgs, &block) end |
#with_level(level, message) ⇒ Object
Log the message at the given level.
14 15 16 |
# File 'lib/contrast/logger/time.rb', line 14 def with_level level, send(level.to_sym, ) end |