Class: Yell::Adapters::Io

Inherits:
Base
  • Object
show all
Includes:
Formatter::Helpers
Defined in:
lib/yell/adapters/io.rb

Direct Known Subclasses

File, Stderr, Stdout

Constant Summary collapse

Colors =

The possible unix log colors

{
  0   => "\e[32;1m",  # green;bold
  # 1   => "\e[0m",     # white
  2   => "\e[33;1m",  # yello;bold
  3   => "\e[31;1m",  # red;bold
  4   => "\e[35;1m",  # magenta;bold
  5   => "\e[36m",    # cyan
  -1  => "\e[0m"      # NONE
}

Instance Attribute Summary collapse

Attributes included from Formatter::Helpers

#format

Attributes included from Level::Helpers

#level

Instance Method Summary collapse

Methods inherited from Base

#close, close, #initialize, setup, write, #write

Constructor Details

This class inherits a constructor from Yell::Adapters::Base

Instance Attribute Details

#colorsObject

Returns the value of attribute colors.



46
47
48
# File 'lib/yell/adapters/io.rb', line 46

def colors
  @colors
end

Instance Method Details

#colorize!Object

Shortcut to enable colors



49
# File 'lib/yell/adapters/io.rb', line 49

def colorize!; @colors = true; end