Class: Cosmo::Logger::SimpleFormatter

Inherits:
BaseFormatter
  • Object
show all
Defined in:
lib/cosmo/logger.rb

Instance Method Summary collapse

Methods inherited from BaseFormatter

#pid, #tid

Instance Method Details

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



41
42
43
44
45
# File 'lib/cosmo/logger.rb', line 41

def call(severity, time, _, msg)
  options = Context.current.compact.map { |k, v| "#{k}=#{v}" }.join(" ")
  options &&= " #{options}" unless options.empty?
  "#{time.utc.iso8601(3)} #{severity} pid=#{pid} tid=#{tid}#{options}: #{msg2str(msg)}\n"
end