Class: GitReflow::Logger::SimpleFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/git_reflow/logger.rb

Overview

Simple formatter which only displays the message.

Instance Method Summary collapse

Instance Method Details

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

This method is invoked when a log event occurs



25
26
27
28
29
30
31
# File 'lib/git_reflow/logger.rb', line 25

def call(severity, timestamp, progname, msg)
  if $stdout.tty?
    "#{severity.colorize(COLORS[severity])}: #{String === msg ? msg : msg.inspect}\n"
  else
    "#{severity}: #{String === msg ? msg : msg.inspect}\n"
  end
end