Class TextFileMessageLogger

Object
TextFileMessageLogger
All Implemented Interfaces:
MessageLogger, StatefulMessageLogger

public class TextFileMessageLogger extends Object implements StatefulMessageLogger
Logs messages to a text-file.

Both the path of text-file can be determined in different ways by the constructor, and whether it is written at all.

Author:
Owen Feehan
  • Constructor Details

    • TextFileMessageLogger

      public TextFileMessageLogger(String filePath, ErrorReporter errorReporter)
      Constructs a logger that (always) writes messages to a text-file with a specific path.
      Parameters:
      filePath - path to write the log to
      errorReporter - error-reporter an error is outputted here if the log cannot be created, and no further logging occurs.
    • TextFileMessageLogger

      public TextFileMessageLogger(String outputName, OutputterChecked outputter, ErrorReporter errorReporter)
      Constructs a logger that (maybe) writes messages to a text-file, with a path based upon an output name applied to a OutputterChecked.

      The message-log will only be outputted, if allowed by the OutputterChecked.

      Parameters:
      outputName - output-name
      outputter - output-manager
      errorReporter - error-reporter an error is outputted here if the log cannot be created, and no further logging occurs.
  • Method Details