Class: Opee::Log

Inherits:
Actor show all
Defined in:
lib/opee/log.rb

Overview

An asynchronous logger build on top of the Actor class. It is able to log messages as well as forward calls to a #forward Actor.

Constant Summary

Constant Summary

Constants inherited from Actor

Actor::CLOSING, Actor::RUNNING, Actor::STEP, Actor::STOPPED

Instance Attribute Summary

Attributes inherited from Actor

#name, #state

Instance Method Summary (collapse)

Methods inherited from Actor

#ask, #ask_timeout, #backed_up, #busy?, #close, #max_queue_count, #method_missing, #on_idle, #priority_ask, #proc_count, #queue_count, #start, #state_string, #step, #stop, #timeout_ask, #wakeup

Constructor Details

- (Log) initialize(options = {})

Returns a new instance of Log



9
10
11
12
13
14
# File 'lib/opee/log.rb', line 9

def initialize(options={})
  @logger = nil
  @forward = nil
  @formatter = nil
  super(options)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Opee::Actor

Instance Method Details

- (Logger::Formatter) formatter

Returns the current formatter.

Returns:

  • (Logger::Formatter)

    current formatter



25
26
27
# File 'lib/opee/log.rb', line 25

def formatter()
  @formatter
end

- (Log) forward

Returns the forward Log Actor if one has been set.

Returns:

  • (Log)

    the forward Log Actor if set



31
32
33
# File 'lib/opee/log.rb', line 31

def forward()
  @forward
end

- (Fixnum) severity Also known as: level

Returns the current severity level.

Returns:

  • (Fixnum)

    Logger severity level



18
19
20
# File 'lib/opee/log.rb', line 18

def severity()
  @logger.level
end