class Puggle::LoggingFormatter

Public Instance Methods

call(severity, timestamp, _progname, msg) click to toggle source
# File lib/puggle/logging_formatter.rb, line 5
def call (severity, timestamp, _progname, msg)
  unless msg.blank?
    "[#{process_id}] [#{timestamp}] [#{color_severity(severity)}] #{tags_text}#{msg}\n"
  end
end
color_severity(severity) click to toggle source
# File lib/puggle/logging_formatter.rb, line 11
def color_severity (severity)
  case severity
  when "ERROR", "FATAL" then severity.red
  when "WARN" then severity.yellow
  else
    severity
  end
end
process_id() click to toggle source
# File lib/puggle/logging_formatter.rb, line 20
def process_id
  @process_id ||= Process.pid
end