Class: Polytrix::Logger::LogdevLogger
- Inherits:
-
Logger
- Object
- Logger
- Polytrix::Logger::LogdevLogger
- Defined in:
- lib/polytrix/logger.rb
Overview
Internal class which adds a #banner method call that displays the message with a callout arrow.
Direct Known Subclasses
Instance Method Summary collapse
-
#<<(msg) ⇒ Object
Dump one or more messages to info.
-
#banner(msg = nil, &block) ⇒ Object
Log a banner message.
Instance Method Details
#<<(msg) ⇒ Object
Dump one or more messages to info.
293 294 295 296 297 298 299 300 301 302 303 |
# File 'lib/polytrix/logger.rb', line 293 def <<(msg) @buffer ||= '' lines, _, remainder = msg.rpartition("\n") if lines.empty? @buffer << remainder else lines.insert(0, @buffer) lines.split("\n").each { |l| format_line(l.chomp) } @buffer = '' end end |
#banner(msg = nil, &block) ⇒ Object
Log a banner message.
308 309 310 |
# File 'lib/polytrix/logger.rb', line 308 def (msg = nil, &block) super_info("-----> #{msg}", &block) end |