Class: ColorizeLogs::Formatter
- Inherits:
-
ActiveSupport::Logger::SimpleFormatter
- Object
- ActiveSupport::Logger::SimpleFormatter
- ColorizeLogs::Formatter
- Includes:
- ActiveSupport::TaggedLogging::Formatter
- Defined in:
- lib/colorize_logs/formatter.rb
Overview
Custom formatter for Rails logger
Instance Method Summary collapse
- #call(severity, time, progname, msg) ⇒ Object
- #configure(&block) ⇒ Object
-
#initialize ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize ⇒ Formatter
Returns a new instance of Formatter.
11 12 13 14 15 |
# File 'lib/colorize_logs/formatter.rb', line 11 def initialize super @matchers = {} end |
Instance Method Details
#call(severity, time, progname, msg) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/colorize_logs/formatter.rb', line 22 def call(severity, time, progname, msg) return if msg.blank? msg = (msg) super(severity, time, progname, msg) end |
#configure(&block) ⇒ Object
17 18 19 20 |
# File 'lib/colorize_logs/formatter.rb', line 17 def configure(&block) instance_eval(&block) self end |