Parent

Namespace

Yell::Event

Yell::Event.new( :info, 'Hello World', { :scope => 'Application' } ) #=> Hello World scope: Application

Constants

CallerIndex

jruby and rubinius seem to have a different caller

CallerRegexp

regex to fetch caller attributes

Attributes

level[R]

Accessor to the log level

messages[R]

Accessor to the log message

name[R]

Accessor to the logger’s name

time[R]

Accessor to the time the log event occured

Public Class Methods

new( logger, options, *messages, &block ) click to toggle source
# File lib/yell/event.rb, line 51
def initialize( logger, options, *messages, &block )
  @time = Time.now
  @name = logger.name

  extract!(options)

  @messages = messages
  @messages << block.call unless block.nil?

  @caller = logger.trace.at?(level) ? caller[caller_index].to_s : ''
  @file = nil
  @line = nil
  @method = nil

  @pid = nil
end

Public Instance Methods

file() click to toggle source

Accessor to filename the log event occured

# File lib/yell/event.rb, line 89
def file
  @file || (backtrace!; @file)
end
hostname() click to toggle source

Accessor to the hostname

# File lib/yell/event.rb, line 69
def hostname
  @@hostname
end
line() click to toggle source

Accessor to the line the log event occured

# File lib/yell/event.rb, line 94
def line
  @line || (backtrace!; @line)
end
method() click to toggle source

Accessor to the method the log event occured

# File lib/yell/event.rb, line 99
def method
  @method || (backtrace!; @method)
end
pid() click to toggle source

Accessor to the PID

# File lib/yell/event.rb, line 79
def pid
  Process.pid
end
progname() click to toggle source

Accessor to the progname

# File lib/yell/event.rb, line 74
def progname
  @@progname
end
thread_id() click to toggle source

Accessor to the thread’s id

# File lib/yell/event.rb, line 84
def thread_id
  Thread.current.object_id
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.