Class: VidazingLogger::LayoutPattern Private
- Inherits:
-
Object
- Object
- VidazingLogger::LayoutPattern
- Defined in:
- lib/vidazing_logger/layout_pattern.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Determines the format for the logger messages
Instance Attribute Summary collapse
- #layout ⇒ Object readonly private
Class Method Summary collapse
- .basic ⇒ Object private
- .colored(color_scheme_name) ⇒ Object private
Instance Method Summary collapse
-
#initialize(color_scheme_name) ⇒ LayoutPattern
constructor
private
A new instance of LayoutPattern.
Constructor Details
#initialize(color_scheme_name) ⇒ LayoutPattern
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 LayoutPattern.
11 12 13 14 |
# File 'lib/vidazing_logger/layout_pattern.rb', line 11 def initialize(color_scheme_name) @layout = LayoutPattern.basic.dup @layout[:color_scheme] = color_scheme_name end |
Instance Attribute Details
#layout ⇒ 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.
9 10 11 |
# File 'lib/vidazing_logger/layout_pattern.rb', line 9 def layout @layout end |
Class Method Details
.basic ⇒ Object
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.
21 22 23 24 25 26 27 |
# File 'lib/vidazing_logger/layout_pattern.rb', line 21 def basic { pattern: '[%d] %-5l %c: %m\n', # ISO8601 without the 'T' date_pattern: '%Y-%m-%d %H:%M:%S' } end |
.colored(color_scheme_name) ⇒ Object
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.
17 18 19 |
# File 'lib/vidazing_logger/layout_pattern.rb', line 17 def colored(color_scheme_name) LayoutPattern.new(color_scheme_name) end |