Class: FlatKit::LogFormatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- FlatKit::LogFormatter
- Defined in:
- lib/flat_kit/log_formatter.rb
Overview
Internal: Log formatting class for FlatKit
Constant Summary collapse
- FORMAT =
"%s %5d %05s : %s\n"
- DATETIME_FORMAT =
"%Y-%m-%dT%H:%M:%SZ"
Instance Method Summary collapse
- #call(severity, time, _progname, msg) ⇒ Object
-
#initialize ⇒ LogFormatter
constructor
A new instance of LogFormatter.
Constructor Details
#initialize ⇒ LogFormatter
Returns a new instance of LogFormatter.
11 12 13 14 |
# File 'lib/flat_kit/log_formatter.rb', line 11 def initialize super self.datetime_format = DATETIME_FORMAT end |
Instance Method Details
#call(severity, time, _progname, msg) ⇒ Object
16 17 18 |
# File 'lib/flat_kit/log_formatter.rb', line 16 def call(severity, time, _progname, msg) format(FORMAT, format_datetime(time.utc), Process.pid, severity, msg2str(msg)) end |