class Semlogr::LogSeverity

Constants

DEBUG
ERROR
FATAL
INFO
WARN

Attributes

value[R]

Public Class Methods

create(severity) click to toggle source
# File lib/semlogr/log_severity.rb, line 14
def self.create(severity)
  case severity
  when LogSeverity
    severity
  when :debug
    LogSeverity::DEBUG
  when :info
    LogSeverity::INFO
  when :warn
    LogSeverity::WARN
  when :error
    LogSeverity::ERROR
  when :fatal
    LogSeverity::FATAL
  else
    LogSeverity::DEBUG
  end
end
new(value, display_string) click to toggle source
# File lib/semlogr/log_severity.rb, line 9
def initialize(value, display_string)
  @value = value
  @display_string = display_string
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/semlogr/log_severity.rb, line 33
def <=>(other)
  @value <=> other.value
end
to_s() click to toggle source
# File lib/semlogr/log_severity.rb, line 37
def to_s
  @display_string
end