class Sawmill::Entry::Attribute

A log entry containing a log record attribute.

Attributes

key[R]

The attribute key as a string

level[R]

The log level as a Sawmill::Level object

operation[R]

The operation, which can currently be :set or :append

progname[R]

The progname as a string

record_id[R]

The record ID as a string

timestamp[R]

The timestamp as a Time object

value[R]

The attribute value as a string

Public Class Methods

new(level_, timestamp_, progname_, record_id_, key_, value_, operation_=nil) click to toggle source
# File lib/sawmill/entry.rb, line 257
def initialize(level_, timestamp_, progname_, record_id_, key_, value_, operation_=nil)
  @level = level_
  @timestamp = timestamp_
  @progname = progname_.to_s
  @progname.gsub!(%r\s+/, '')
  @record_id = record_id_.nil? ? nil : record_id_.to_s
  @record_id.gsub!(%r\s+/, '') if @record_id
  @key = key_.to_s
  @key.gsub!(%r\s+/, '')
  @value = value_.to_s
  @operation = operation_ || :set
end

Public Instance Methods

type() click to toggle source

Returns :attribute

# File lib/sawmill/entry.rb, line 272
def type; :attribute; end