class Lumberjack::LogEntry

information about the system that logged the message.
An entry in a log is a data structure that captures the log message as well as

def initialize(time, severity, message, progname, pid, tags)

Parameters:
  • tags (Hash) -- A hash of tags to associate with the log entry.
  • pid (Integer) -- The process id of the program that created the log entry.
  • progname (String) -- The name of the program that created the log entry.
  • message (String) -- The message to log.
  • severity (Integer, String) -- The severity of the log entry.
  • time (Time) -- The time the log entry was created.
def initialize(time, severity, message, progname, pid, tags)
  @time = time
  @severity = (severity.is_a?(Integer) ? severity : Severity.label_to_level(severity))
  @message = message
  @progname = progname
  @pid = pid
  # backward compatibility with 1.0 API where the last argument was the unit of work id
  @tags = if tags.nil? || tags.is_a?(Hash)
    tags
  else
    {UNIT_OF_WORK_ID => tags}
  end
end

def inspect

def inspect
  to_s
end

def severity_label

def severity_label
  Severity.level_to_label(severity)
end

def tag(name)

Return the tag with the specified name.
def tag(name)
  tags[name.to_s] if tags
end

def tags_to_s

def tags_to_s
  tags_string = +""
  tags&.each { |name, value| tags_string << " #{name}:#{value.inspect}" }
  tags_string
end

def to_s

def to_s
  "[#{time.strftime(TIME_FORMAT)}.#{(time.usec / 1000.0).round.to_s.rjust(3, "0")} #{severity_label} #{progname}(#{pid})#{tags_to_s}] #{message}"
end

def unit_of_work_id

Deprecated - backward compatibility with 1.0 API
def unit_of_work_id
  tags[UNIT_OF_WORK_ID] if tags
end

def unit_of_work_id=(value)

Deprecated - backward compatibility with 1.0 API
def unit_of_work_id=(value)
  if tags
    tags[UNIT_OF_WORK_ID] = value
  else
    @tags = {UNIT_OF_WORK_ID => value}
  end
end