Class: SmartLoggerWrapper::Options::AppendBacktrace

Inherits:
Base
  • Object
show all
Includes:
Utils::Backtrace
Defined in:
lib/smart_logger_wrapper/options/append_backtrace.rb

Instance Method Summary collapse

Methods included from Utils::Backtrace

clean_backtrace, get_backtrace

Instance Method Details

#apply!(messages, arguments, severity, wrapper) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/smart_logger_wrapper/options/append_backtrace.rb', line 10

def apply!(messages, arguments, severity, wrapper)
  length = arguments.first.is_a?(Numeric) ? arguments.first : nil
  messages << [
    'BACKTRACE:',
    *get_backtrace(wrapper.offset + APPLY_CALLER_STACK_DEPTH + 1, length)
  ].join("\n")
end