public void writeLog(Log log)
{
try
{
// Get log writer
LogWriter logWriter = new LogWriterImpl();
logWriter.setWriter(ifile.getLocation().toString());
// Write start of log file
logWriter.write(new StringReader(log.getStartXMLString("")));
// Write monitor tool information
String monitorInfo = generateMonitorToolInfo();
logWriter.write(new StringReader(monitorInfo));
for (int i=0; i<log.getEntryCount(); i++)
{
MessageEntry me = log.getLogEntry(i);
logWriter.write(new StringReader(me.toXMLString("")));
}
logWriter.write(new StringReader(log.getEndXMLString("")));
logWriter.close();
}
catch (Exception e)
{
System.out.println("Exception thrown when printing log file.");
}