Writes unstructured messages to a file. Hoodoo::Logger::SlowWriter subclass. See also Hoodoo::Logger.

Methods
N
R
Included Modules
Class Public methods
new( pathname )

Create a file writer instance. Files are written by opening, adding a log message and closing again, to provide reliability. For this reason, this is a Hoodoo::Logger::SlowWriter subclass.

If you want faster file access at the expense of immediate updates / reliability due to buffering, open a file externally to create an I/O stream and pass this persistently-open file's stream to an Hoodoo::Logger::StreamWriter class instead.

pathname

Full pathname of a file that can be opened in “ab” (append for writing at end-of-file) mode.

# File lib/hoodoo/logger/writers/file_writer.rb, line 32
def initialize( pathname )
  @pathname = pathname
end
Instance Public methods
report( log_level, component, code, data )
# File lib/hoodoo/logger/writers/file_writer.rb, line 38
def report( log_level, component, code, data )
  File.open( @pathname, 'ab' ) do | file |
    file.puts( flatten( log_level, component, code, data ) )
  end
end