Class: XLogger::Formatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/bin_script/xlogger.rb

Instance Method Summary collapse

Instance Method Details

#call(severity, time, progname, msg) ⇒ Object



31
32
33
34
35
36
37
38
39
# File 'lib/bin_script/xlogger.rb', line 31

def call(severity, time, progname, msg)
  if severity == 'INFO' && msg.nil?
    # use this if you want a simple blank line without date in your logs:
    # just call a logger.info without any params
    "\n"
  else
    format_datetime(time) << " " <<  msg2str(msg) << "\n"
  end
end