Module: TTK::Logger::Severity

Defined in:
lib/ttk/logger/severity.rb

Constant Summary collapse

@@labels =
%w(DEBUG VERBOSE_INFO INFO WARN ERROR FATAL UNKNOWN)
@@lower =
0
@@higher =
@@labels.size - 1

Class Method Summary collapse

Class Method Details

.higherObject



27
28
29
# File 'lib/ttk/logger/severity.rb', line 27

def higher
  @@higher
end

.label(level) ⇒ Object

FIXME add the insert method



49
50
51
# File 'lib/ttk/logger/severity.rb', line 49

def label(level)
  @@labels[level]
end

.labelsObject



53
54
55
# File 'lib/ttk/logger/severity.rb', line 53

def labels
  @@labels
end

.lowerObject



23
24
25
# File 'lib/ttk/logger/severity.rb', line 23

def lower
  @@lower
end

.push(*levels) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/ttk/logger/severity.rb', line 39

def push(*levels)
  levels.each do |l|
    @@higher += 1
    const_set(l, @@higher)
    @@labels.push(l)
  end
end

.unshift(*levels) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/ttk/logger/severity.rb', line 31

def unshift(*levels)
  levels.each do |l|
    @@lower -= 1
    const_set(l, @@lower)
    @@labels.unshift(l)
  end
end