Loggability::LogDevice::

Appending class

A log device that appends to the object it’s constructed with instead of writing to a file descriptor or a file.

Attributes

target R

The target of the log device

Public Class Methods

new( target )

Create a new Appending log device that will append content to array.

# File lib/loggability/log_device/appending.rb, line 12
def initialize( target )
        @target = target || []
end

Public Instance Methods

close()

No-op – this is here just so Logger doesn’t complain

# File lib/loggability/log_device/appending.rb, line 32
def close; end
write( message )

Append the specified message to the target.

# File lib/loggability/log_device/appending.rb, line 26
def write( message )
        @target << message
end