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.
      21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 21 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.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def bold @bold end  | 
  
#clear ⇒ Object
Returns the value of attribute clear.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def clear @clear end  | 
  
#debug ⇒ Object
Returns the value of attribute debug.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def debug @debug end  | 
  
#error ⇒ Object
Returns the value of attribute error.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def error @error end  | 
  
#fatal ⇒ Object
Returns the value of attribute fatal.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def fatal @fatal end  | 
  
#info ⇒ Object
Returns the value of attribute info.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def info @info end  | 
  
#trace ⇒ Object
Returns the value of attribute trace.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def trace @trace end  | 
  
#warn ⇒ Object
Returns the value of attribute warn.
      19 20 21  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 19 def warn @warn end  | 
  
Instance Method Details
#[](level) ⇒ Object
      39 40 41  | 
    
      # File 'lib/semantic_logger/formatters/color.rb', line 39 def [](level) public_send(level) end  |