Class: Dry::Logger::Formatters::String
- Inherits:
-
Structured
- Object
- Logger::Formatter
- Structured
- Dry::Logger::Formatters::String
- Defined in:
- lib/dry/logger/formatters/string.rb
Overview
Basic string formatter.
This formatter returns log entries in key=value format.
Direct Known Subclasses
Constant Summary collapse
- HASH_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
","
- EXCEPTION_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
": "
- DEFAULT_SEVERITY_COLORS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
{ DEBUG => :cyan, INFO => :magenta, WARN => :yellow, ERROR => :red, FATAL => :red, UNKNOWN => :blue }.freeze
Constants inherited from Structured
Dry::Logger::Formatters::Structured::DEFAULT_FILTERS, Dry::Logger::Formatters::Structured::NOOP_FILTER
Instance Attribute Summary collapse
- #template ⇒ Object readonly private
Attributes inherited from Structured
Instance Method Summary collapse
- #colorize? ⇒ Boolean private
-
#initialize(template: Logger.templates[:default], **options) ⇒ String
constructor
private
A new instance of String.
Methods inherited from Structured
Constructor Details
#initialize(template: Logger.templates[:default], **options) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of String.
43 44 45 46 |
# File 'lib/dry/logger/formatters/string.rb', line 43 def initialize(template: Logger.templates[:default], **) super(**) @template = Template[template] end |
Instance Attribute Details
#template ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/dry/logger/formatters/string.rb', line 39 def template @template end |
Instance Method Details
#colorize? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'lib/dry/logger/formatters/string.rb', line 50 def colorize? [:colorize].equal?(true) end |