# Author:: Nicolas Despres . # Copyright:: Copyright (c) 2004, 2005 Uttk team. All rights reserved. # License:: LGPL # $Id: /fey/uttk/trunk/lib/uttk/logger/severity.rb 8778 2005-09-26T04:34:48.103938Z ertai $ module Uttk class Logger module Severity @@labels = %w(DEBUG VERBOSE_INFO INFO WARN ERROR FATAL UNKNOWN) @@lower = 0 @@higher = @@labels.size - 1 @@labels.each_with_index do |label, i| const_set(label, i) end module_function def lower @@lower end def higher @@higher end def unshift(*levels) levels.each do |l| @@lower -= 1 const_set(l, @@lower) @@labels.unshift(l) end end def push(*levels) levels.each do |l| @@higher += 1 const_set(l, @@higher) @@labels.push(l) end end # FIXME add the insert method def label(level) @@labels[level] end def labels @@labels end end # module Severity end # class Logger end # module Uttk