Class: Pakyow::Logger::Formatter
- Inherits:
-
Object
- Object
- Pakyow::Logger::Formatter
- Defined in:
- lib/pakyow/logger/formatter.rb
Direct Known Subclasses
Pakyow::Logger::Formatters::Human, Pakyow::Logger::Formatters::JSON
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #call(event, **options) ⇒ Object
-
#initialize(output) ⇒ Formatter
constructor
A new instance of Formatter.
- #verbose!(value) ⇒ Object
Constructor Details
#initialize(output) ⇒ Formatter
Returns a new instance of Formatter.
8 9 10 |
# File 'lib/pakyow/logger/formatter.rb', line 8 def initialize(output) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
6 7 8 |
# File 'lib/pakyow/logger/formatter.rb', line 6 def output @output end |
Instance Method Details
#call(event, **options) ⇒ Object
12 13 14 15 |
# File 'lib/pakyow/logger/formatter.rb', line 12 def call(event, **) event = yield if block_given? format(event, **) end |
#verbose!(value) ⇒ Object
17 18 19 |
# File 'lib/pakyow/logger/formatter.rb', line 17 def verbose!(value) @verbose = value end |