Class: Wright::Logger::Formatter Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Default formatter for Wright log messages.

API:

  • private

Instance Method Summary collapse

Instance Method Details

#call(severity, _time, _progname, message) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method is called by Wright::Logger to format log messages.

Parameters:

  • the log entry’s severity

  • the log entry’s time stamp (ignored)

  • the log entry’s program name (ignored)

  • the log message

Returns:

  • the formatted log entry

API:

  • private



21
22
23
24
25
26
27
28
# File 'lib/wright/logger.rb', line 21

def call(severity, _time, _progname, message)
  log_entry = "#{severity}: #{message}\n"
  if Wright::Config[:log][:colorize]
    colorize(log_entry, severity)
  else
    log_entry
  end
end