org.ispheres.server.core
Class LogFile

java.lang.Object
  extended by org.ispheres.server.core.LogFile

public class LogFile
extends java.lang.Object

Used to write to xml error log files.

Author:
Owen Jones

Constructor Summary
LogFile(java.io.File file)
          Construct a LogFile from a File.
 
Method Summary
 void close()
          Close the LogFile, saving the changes.
 void writeError(java.lang.String type, java.lang.String reason)
          Append the reason as an error to the errorlog.
 void writeError(java.lang.Throwable e)
          Append the exception to the end of the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFile

public LogFile(java.io.File file)
        throws java.io.IOException
Construct a LogFile from a File.

Parameters:
file - the file to write the log to.
Throws:
java.io.IOException - if the log file does not exist.
Method Detail

writeError

public final void writeError(java.lang.Throwable e)
                      throws java.io.IOException
Append the exception to the end of the file.

Parameters:
e - The exception to write to the file.
Throws:
java.io.IOException - if unable to write to the log file.

writeError

public final void writeError(java.lang.String type,
                             java.lang.String reason)
                      throws java.io.IOException
Append the reason as an error to the errorlog.

Parameters:
type - the type (name) of the error.
reason - an explanation of the error.
Throws:
java.io.IOException - if unable to write to the log file.

close

public final void close()
                 throws java.io.IOException
Close the LogFile, saving the changes.

Throws:
java.io.IOException - if unable to write to the log file.


Copyright © 2004-2005 The Archaeological Computing Laboratory, University of Sydney. All Rights Reserved.