roast
Class LogFile
java.lang.Object
|
+--roast.LogFile
- public class LogFile
- extends java.lang.Object
The LogFile class controls output to the log file.
Constructor Summary |
LogFile()
Constructs a LogFile object which writes output to
System.out in text format. |
LogFile(java.lang.String fileName,
boolean serializeOutput)
Constructs a LogFile object with the specified file
fileName and output mode. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
LogFile
public LogFile()
- Constructs a LogFile object which writes output to
System.out in text format.
LogFile
public LogFile(java.lang.String fileName,
boolean serializeOutput)
throws ParameterException,
java.io.IOException
- Constructs a LogFile object with the specified file
fileName and output mode. If fileName is
null, output is written to System.out.
If serializeOutput is true then any messages written
to the log file are serialized message objects; otherwise,
messages are written as plain text.
- Parameters:
fileName
- the file name of the log file;
null if output should be written to System.outserializeOutput
- true writes serialized message objects to the log file;
false writes message text to the log file- Throws:
- ParameterException - if fileName is null and
serializeOutput is true
writeMessage
public void writeMessage(UtilityMessage uMessage)
throws java.io.IOException
- Write a utility message to the log file.
- Parameters:
uMessage
- the message to be written to the log file- Throws:
- java.io.IOException - if an error occurs writing to the log file
writeMessage
public void writeMessage(FailureMessage fMessage)
throws java.io.IOException
- Write a failure message to the log file.
- Parameters:
fMessage
- the message to be written to the log file- Throws:
- java.io.IOException - if an error occurs writing to the log file
finalize
public void finalize()
- Closes log file stream.
- Overrides:
- finalize in class java.lang.Object
convertSerializeToText
public static boolean convertSerializeToText(java.lang.String input,
java.lang.String output)
- Converts a serialized log file to a plain text log file. If
output is null, the output is written
to System.out.
- Parameters:
input
- the name of the input fileoutput
- the name of the output file; null indicates that
output will be written to System.out- Returns:
- true if conversion is successful;
false otherwise
main
public static void main(java.lang.String[] args)