Class: AlpacaBuildTool::RainbowifyFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/alpacabuildtool/log/rainbowify_formatter.rb

Overview

RainbowifyFormatter provides formatting for standart ruby logger by adding colors(rainbow gem) and ASCII art headers for HEADER (6) severity

Instance Method Summary collapse

Instance Method Details

#call(severity, datetime, _progname, message) ⇒ Object

Provides custom logging implementation

severity

severity to log(HEADER, PUTS, INFO, ERROR…)

datetime

date time stamp

progname

not used here

message

message to log


20
21
22
23
24
25
26
# File 'lib/alpacabuildtool/log/rainbowify_formatter.rb', line 20

def call(severity, datetime, _progname, message)
  case severity
  when 'HEADER' then header(message)
  when 'PUTS' then puts(message)
  else usual(message, severity, datetime)
  end
end