Class: VidazingLogger::LayoutPattern Private

Inherits:
Object
  • Object
show all
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

Since:

  • 0.2.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Since:

  • 0.2.0



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

#layoutObject (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.

Since:

  • 0.2.0



9
10
11
# File 'lib/vidazing_logger/layout_pattern.rb', line 9

def layout
  @layout
end

Class Method Details

.basicObject

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.

Since:

  • 0.2.0



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.

Since:

  • 0.2.0



17
18
19
# File 'lib/vidazing_logger/layout_pattern.rb', line 17

def colored(color_scheme_name)
  LayoutPattern.new(color_scheme_name)
end