org.prorefactor.io
Class LogWriter

java.lang.Object
  extended by org.prorefactor.io.LogWriter

public class LogWriter
extends java.lang.Object

Provides log and status writing. From LogFile, writes to statusLog, errorLog, and exceptionLog. Optionally logs output and errors to a PrintStream.


Constructor Summary
LogWriter(java.io.PrintStream printStream)
          The printStream is optional (use null if you don't want one).
 
Method Summary
 void close()
          Closes the log files, but not the print stream.
 void log(java.lang.String logText)
          Log the process status with newline.
 void logError(java.lang.String errorLogPrefix, java.lang.String errorText)
          Log an error.
 void logException(java.lang.String logPrefix, java.lang.Exception exception)
          Log an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogWriter

public LogWriter(java.io.PrintStream printStream)
          throws java.io.IOException
The printStream is optional (use null if you don't want one).

Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Closes the log files, but not the print stream.

Throws:
java.io.IOException

log

public void log(java.lang.String logText)
         throws java.io.IOException
Log the process status with newline.

Throws:
java.io.IOException

logError

public void logError(java.lang.String errorLogPrefix,
                     java.lang.String errorText)
              throws java.io.IOException
Log an error. Writes the optional errorLogPrefix to a line in the error log prior to writing the error text to the printStream, the outputLog, and the errorLog.

Throws:
java.io.IOException

logException

public void logException(java.lang.String logPrefix,
                         java.lang.Exception exception)
                  throws java.io.IOException
Log an exception. Writes the optional logPrefix to a line in the error log and exception log prior to writing the exception message to the printStream, the outputLog, and the errorLog, and the exception stack trace to the exceptionLog.

Throws:
java.io.IOException


Copyright © 2008 Joanju Software. All Rights Reserved.