Loggability::LogDevice::

File class

A log device that delegates to the ruby’s default Logger’s file device and writes to a file descriptor or a file.

Attributes

target R

The target of the log device

Public Class Methods

new( target )

Create a new File device that will write to the file using the built-in ruby’s File log device

# File lib/loggability/log_device/file.rb, line 13
def initialize( target )
        @target = ::Logger::LogDevice.new( target )
end

Public Instance Methods

close()

close the file

# File lib/loggability/log_device/file.rb, line 33
def close
        self.target.close
end
write( message )

Append the specified message to the target.

# File lib/loggability/log_device/file.rb, line 27
def write( message )
        self.target.write( message )
end