Class: SemanticLogger::Formatters::Color::ColorMap
- Inherits:
-
Object
- Object
- SemanticLogger::Formatters::Color::ColorMap
- Defined in:
- lib/semantic_logger/formatters/color.rb
Overview
Supply a custom color map for every log level
Instance Attribute Summary collapse
-
#bold ⇒ Object
Returns the value of attribute bold.
-
#clear ⇒ Object
Returns the value of attribute clear.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#error ⇒ Object
Returns the value of attribute error.
-
#fatal ⇒ Object
Returns the value of attribute fatal.
-
#info ⇒ Object
Returns the value of attribute info.
-
#trace ⇒ Object
Returns the value of attribute trace.
-
#warn ⇒ Object
Returns the value of attribute warn.
Instance Method Summary collapse
- #[](level) ⇒ Object
-
#initialize(trace: AnsiColors::MAGENTA, debug: AnsiColors::GREEN, info: AnsiColors::CYAN, warn: AnsiColors::BOLD, error: AnsiColors::RED, fatal: AnsiColors::RED, bold: AnsiColors::BOLD, clear: AnsiColors::CLEAR) ⇒ ColorMap
constructor
A new instance of ColorMap.
Constructor Details
#initialize(trace: AnsiColors::MAGENTA, debug: AnsiColors::GREEN, info: AnsiColors::CYAN, warn: AnsiColors::BOLD, error: AnsiColors::RED, fatal: AnsiColors::RED, bold: AnsiColors::BOLD, clear: AnsiColors::CLEAR) ⇒ ColorMap
Returns a new instance of ColorMap.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/semantic_logger/formatters/color.rb', line 17 def initialize(trace: AnsiColors::MAGENTA, debug: AnsiColors::GREEN, info: AnsiColors::CYAN, warn: AnsiColors::BOLD, error: AnsiColors::RED, fatal: AnsiColors::RED, bold: AnsiColors::BOLD, clear: AnsiColors::CLEAR) @trace = trace @debug = debug @info = info @warn = warn @error = error @fatal = fatal @bold = bold @clear = clear end |
Instance Attribute Details
#bold ⇒ Object
Returns the value of attribute bold.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def bold @bold end |
#clear ⇒ Object
Returns the value of attribute clear.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def clear @clear end |
#debug ⇒ Object
Returns the value of attribute debug.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def debug @debug end |
#error ⇒ Object
Returns the value of attribute error.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def error @error end |
#fatal ⇒ Object
Returns the value of attribute fatal.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def fatal @fatal end |
#info ⇒ Object
Returns the value of attribute info.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def info @info end |
#trace ⇒ Object
Returns the value of attribute trace.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def trace @trace end |
#warn ⇒ Object
Returns the value of attribute warn.
15 16 17 |
# File 'lib/semantic_logger/formatters/color.rb', line 15 def warn @warn end |
Instance Method Details
#[](level) ⇒ Object
35 36 37 |
# File 'lib/semantic_logger/formatters/color.rb', line 35 def [](level) public_send(level) end |