Class: Jinx::MultilineLogger
Overview
Extends the standard Logger to format multi-line messages on separate lines.
Instance Method Summary collapse
-
#format_message(severity, datetime, progname, msg) ⇒ Object
private
Writes msg to the log device.
-
#initialize(*args) ⇒ MultilineLogger
constructor
A new instance of MultilineLogger.
Constructor Details
#initialize(*args) ⇒ MultilineLogger
Returns a new instance of MultilineLogger.
25 26 27 |
# File 'lib/jinx/helpers/log.rb', line 25 def initialize(*args) super end |
Instance Method Details
#format_message(severity, datetime, progname, msg) ⇒ Object (private)
Writes msg to the log device. Each line in msg is formatted separately.
39 40 41 42 43 44 45 |
# File 'lib/jinx/helpers/log.rb', line 39 def (severity, datetime, progname, msg) if String === msg then msg.inject('') { |s, line| s << super(severity, datetime, progname, line.chomp) } else super end end |