Class: Filum::LogFormatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Filum::LogFormatter
- Defined in:
- lib/filum/log_formatter.rb
Instance Method Summary collapse
- #call(severity, timestamp, progname, msg) ⇒ Object
-
#initialize(options = {}) ⇒ LogFormatter
constructor
A new instance of LogFormatter.
Constructor Details
#initialize(options = {}) ⇒ LogFormatter
Returns a new instance of LogFormatter.
5 6 7 8 |
# File 'lib/filum/log_formatter.rb', line 5 def initialize( = {}) @context_id_length = .fetch(:context_id_length, 6) @filename_length = .fetch(:filename_length, 20) end |
Instance Method Details
#call(severity, timestamp, progname, msg) ⇒ Object
10 11 12 |
# File 'lib/filum/log_formatter.rb', line 10 def call(severity, , progname, msg) "#{} #{formatted_thread_id} [#{formatted_context_id}] #{severity.to_s.ljust(5)} | #{formatted_calling_file_and_line} | #{msg}\n" end |