class LogKernel::Event

Attributes

levelno[R]
msg[R]
pid[R]
tid[R]
ts[R]

Public Class Methods

new( levelno, msg ) click to toggle source
# File lib/logutils/logger.rb, line 58
def initialize( levelno, msg )
  @levelno = levelno    # pass in integer e.g. 0,1,2,3,etc.
  @msg     = msg
  
  @pid   = Process.pid
  @tid   = Thread.current.object_id
  
  @ts    = Time.now
end

Public Instance Methods

error?() click to toggle source
# File lib/logutils/logger.rb, line 83
def error?
  @levelno == ERROR
end
fatal?() click to toggle source
# File lib/logutils/logger.rb, line 79
def fatal?
  @levelno == FATAL
end
level() click to toggle source
# File lib/logutils/logger.rb, line 68
def level
  LEVEL_NAME[ @levelno ]
end
to_s() click to toggle source
# File lib/logutils/logger.rb, line 96
def to_s
  # "[#{level}-#{pid}.#{tid}] #{msg}"
  "[#{level}] #{msg}"
end
unknown?() click to toggle source
# File lib/logutils/logger.rb, line 91
def unknown?
  @levelno == UNKNOWN
end
warn?() click to toggle source
# File lib/logutils/logger.rb, line 87
def warn?
  @levelno == WARN
end