Class: Logfoo::LogfmtFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/logfoo/formatters/logfmt_formatter.rb

Direct Known Subclasses

SimpleFormatter

Constant Summary collapse

UNESCAPED_STRING =
/\A[\w\.\-\+\%\,\:\;\/]*\z/i.freeze
IGNORED_KEYS =
[:time]
FLOAT_FORMAT =
'%0.4f'.freeze

Instance Method Summary collapse

Instance Method Details

#call(entry) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/logfoo/formatters/logfmt_formatter.rb', line 10

def call(entry)
  case entry
  when ExceptionEntry, Entry
    format_entry(entry)
  else
    entry.to_s
  end
end