Class: Fig::Log4r::Outputter

Inherits:
Log4r::IOOutputter
  • Object
show all
Defined in:
lib/fig/log4r/outputter.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, file_handle, hash = {}) ⇒ Outputter

Returns a new instance of Outputter.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fig/log4r/outputter.rb', line 14

def initialize(name, file_handle, hash = {})
  @colors = hash.delete(:colors)
  @colors ||= {
    :debug => :white,
    :info  => :light_white,
    :warn  => :yellow,
    :error => :red,
    :fatal => {:color => :light_yellow, :background => :red}
  }
  @colorize = file_handle.tty? && Fig::OperatingSystem.unix?

  super(name, file_handle, hash)

  initialize_colors_by_level()
end