Module: Rabbit::Logger::Severity

Extended by:
GetText
Included in:
Base
Defined in:
lib/rabbit/logger/base.rb

Constant Summary collapse

DEBUG =
0
INFO =
1
WARNING =
2
ERROR =
3
FATAL =
4
UNKNOWN =
5
MARK_TABLE =
{
  DEBUG => N_("DEBUG"),
  INFO => N_("INFO"),
  WARNING => N_("WARNING"),
  ERROR => N_("ERROR"),
  FATAL => N_("FATAL"),
  UNKNOWN => N_("UNKNOWN"),
}

Constants included from GetText

GetText::DOMAIN

Class Method Summary collapse

Methods included from GetText

N_, _, bindtextdomain, locale=

Class Method Details

.level(name) ⇒ Object



34
35
36
37
38
# File 'lib/rabbit/logger/base.rb', line 34

def level(name)
  MARK_TABLE.find do |key, value|
    value.downcase == name.downcase
  end[0]
end

.name(level) ⇒ Object



30
31
32
# File 'lib/rabbit/logger/base.rb', line 30

def name(level)
  MARK_TABLE[level].downcase
end

.namesObject



26
27
28
# File 'lib/rabbit/logger/base.rb', line 26

def names
  MARK_TABLE.sort_by {|key, _| key}.collect {|_, value| value.downcase}
end