class Kitchen::Logger::LogdevLogger
Internal class which adds a banner
method call that displays the message with a callout arrow.
Public Instance Methods
<<(msg)
click to toggle source
Dump one or more messages to info.
@param msg [String] a message
# File lib/kitchen/logger.rb, line 344 def <<(msg) @buffer ||= "" @buffer += msg while (i = @buffer.index("\n")) format_line(@buffer[0, i].chomp) @buffer[0, i + 1] = "" end end
Private Instance Methods
format_line(line)
click to toggle source
Reformat a line if it already contains log formatting.
@param line [String] a message line @api private
# File lib/kitchen/logger.rb, line 366 def format_line(line) case line when /^-----> / then banner(line.gsub(/^[ >-]{6} /, "")) when /^>>>>>> / then error(line.gsub(/^[ >-]{6} /, "")) when /^ / then info(line.gsub(/^[ >-]{6} /, "")) else info(line) end end