Class: SmartLoggerWrapper::Options::To
- Defined in:
- lib/smart_logger_wrapper/options/to.rb
Instance Method Summary collapse
Instance Method Details
#apply!(messages, arguments, severity, wrapper) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/smart_logger_wrapper/options/to.rb', line 7 def apply!(, arguments, severity, wrapper) raise ApplicationError, 'No handler given' if arguments.empty? out = arguments.first time = Time.now severity_label = wrapper.format_severity(severity) out.puts .map { || wrapper.(severity_label, time, nil, ) }.join("\n") rescue NoMethodError => e raise ApplicationError, e. end |