Class: VidazingLogger::ColorScheme Private

Inherits:
Object
  • Object
show all
Defined in:
lib/vidazing_logger/color_scheme.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.

Set logging colors

Since:

  • 0.2.0

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, date_color:) ⇒ ColorScheme

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 ColorScheme.

Since:

  • 0.2.0



11
12
13
14
15
16
# File 'lib/vidazing_logger/color_scheme.rb', line 11

def initialize(name:, date_color:)
  @name = name

  @scheme = ColorScheme.basic.dup
  @scheme[:date] = date_color
end

Instance Attribute Details

#nameObject (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/color_scheme.rb', line 9

def name
  @name
end

#schemeObject (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/color_scheme.rb', line 9

def scheme
  @scheme
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



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/vidazing_logger/color_scheme.rb', line 27

def basic
  {
    levels: {
      info: :green,
      warn: :yellow,
      error: :red,
      fatal: %i[white on_red]
    },
    logger: :cyan,
    message: :magenta
  }
end

.errorObject

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



23
24
25
# File 'lib/vidazing_logger/color_scheme.rb', line 23

def error
  ColorScheme.new(name: :error, date_color: :red)
end

.normalObject

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



19
20
21
# File 'lib/vidazing_logger/color_scheme.rb', line 19

def normal
  ColorScheme.new(name: :normal, date_color: :blue)
end