org.nukesoft.bot2.botutil
Class Log.LogFile

java.lang.Object
  |
  +--org.nukesoft.bot2.botutil.Log.LogFile
Enclosing class:
Log

private static class Log.LogFile
extends Object

Utility class to mantain a physical log file.

Author:
Ryan Michela

Field Summary
private  String fileName
           
private  PrintWriter pw
           
 
Constructor Summary
Log.LogFile(String fileName)
          Opens a file and writes the log header.
 
Method Summary
 void addEntry(String logString)
          Adds a single entry to the log.
 void flush()
          Flushes this individual log file.
 String getFileName()
          Returns the path this log is working on.
 void shutdown()
          Closes this log file.
private  String timestamp()
          Generates a timestamp.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pw

private PrintWriter pw

fileName

private String fileName
Constructor Detail

Log.LogFile

public Log.LogFile(String fileName)
            throws IOException
Opens a file and writes the log header.

Parameters:
fileName - The file path to open.
Throws:
IOException
Method Detail

addEntry

public void addEntry(String logString)
Adds a single entry to the log.

Parameters:
logString - The string to log.

getFileName

public String getFileName()
Returns the path this log is working on.

Returns:
Path to log file.

flush

public void flush()
Flushes this individual log file.


timestamp

private String timestamp()
Generates a timestamp.

Returns:
String containing the time.

shutdown

public void shutdown()
Closes this log file.