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
STACKTRACE_RE =
/^(.+?):(\d+):in `(.+)'$/.freeze
IGNORED_KEYS =
[:time]
FLOAT_FORMAT =
'%0.4f'.freeze

Instance Method Summary collapse

Instance Method Details

#call(line) ⇒ Object



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

def call(line)
  case line
  when ErrLine, LogLine
    format_line(line)
  else
    "#{remove_nl line.to_s}\n"
  end
end