class Log::Verbosity

@deprecated use Priority instead

@deprecated use Priority instead

Constants

V0
V1
V2
V3
V4
V5

Attributes

value[RW]

Public Class Methods

from_string(s) click to toggle source
# File lib/ec2/amitools/util.rb, line 139
def Verbosity.from_string s
  level = s.to_i
  if not @@levels[level]
    raise ArgumentError.new("invalid logging verbosity level #{level}")
  else
    @@levels[level]
  end
end

Private Class Methods

new(value) click to toggle source
# File lib/ec2/amitools/util.rb, line 121
def initialize value
  @value = value
  @@levels[value] = self
end

Public Instance Methods

>=(operand) click to toggle source
# File lib/ec2/amitools/util.rb, line 135
def >= operand
  @value >= operand.value
end
to_priority() click to toggle source
# File lib/ec2/amitools/util.rb, line 148
def to_priority
  case self
  when V0
    return Priority::ALERT
  when V1
    return Priority::ERR
  when V2
    return Priority::WARNING
  when V3
    return Priority::NOTICE
  when V4
    return Priority::INFO
  else
    return Priority::DEBUG
  end
end