Class: Logfoo::LogfmtFormatter
- Inherits:
-
Object
- Object
- Logfoo::LogfmtFormatter
- Defined in:
- lib/logfoo/formatters/logfmt_formatter.rb
Direct Known Subclasses
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 |