Class: Loggable::Logfmt::Logger::KeyValueFormatter

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

Overview

Custom formatter class that renders logs as in a key-value style using Logfmt formatting

Instance Method Summary collapse

Instance Method Details

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



26
27
28
# File 'lib/loggable/logfmt/logger.rb', line 26

def call(severity, timestamp, progname, msg)
  %(time=#{datetime(timestamp)} severity=#{severity.ljust(5)}#{progname(progname)} #{message(msg)}\n)
end