Class: PaulBunyan::TextFormatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- PaulBunyan::TextFormatter
- Includes:
- ActiveSupport::TaggedLogging::Formatter
- Defined in:
- lib/paul_bunyan/text_formatter.rb
Instance Method Summary collapse
- #call(severity, time, progname, msg) ⇒ Object
-
#initialize(include_metadata: true) ⇒ TextFormatter
constructor
A new instance of TextFormatter.
Constructor Details
#initialize(include_metadata: true) ⇒ TextFormatter
Returns a new instance of TextFormatter.
10 11 12 |
# File 'lib/paul_bunyan/text_formatter.rb', line 10 def initialize(include_metadata: true) @include_metadata = end |
Instance Method Details
#call(severity, time, progname, msg) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/paul_bunyan/text_formatter.rb', line 14 def call(severity, time, progname, msg) = (String === msg ? msg : msg.inspect) if @include_metadata super(severity, time, progname, ) else + "\n" end end |