Module: Rabbit::Logger::Severity

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"),
}

Class Method Summary collapse

Class Method Details

.level(name) ⇒ Object



16
17
18
19
20
# File 'lib/rabbit/logger/base.rb', line 16

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

.N_(message) ⇒ Object



22
23
24
# File 'lib/rabbit/logger/base.rb', line 22

def N_(message)
  message
end

.name(level) ⇒ Object



12
13
14
# File 'lib/rabbit/logger/base.rb', line 12

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

.namesObject



8
9
10
# File 'lib/rabbit/logger/base.rb', line 8

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