Class: Crosstest::Core::LogdevLogger
- Inherits:
-
Logger
- Object
- Logger
- Crosstest::Core::LogdevLogger
- Defined in:
- lib/crosstest/core/logging.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.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/crosstest/core/logging.rb', line 44 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.
59 60 61 |
# File 'lib/crosstest/core/logging.rb', line 59 def (msg = nil, &block) super_info("-----> #{msg}", &block) end |