org.nukesoft.botutil
Class Log

java.lang.Object
  |
  +--org.nukesoft.botutil.Log

public class Log
extends Object

The Log class is used for autonimous log maintnance. One file is created for each path given, regardless of the number of instances referenceing that file. File maintnance is done automaticaly, as are timed log flushes and timestamping. Log enteries from multiple instances are automaticaly interleved within the file.

Author:
Ryan Michela

Constructor Summary
Log(String logFileName)
          Creates a Log object.
 
Method Summary
 void flush()
          Manualy flushes this log file to disk.
static void flushAll()
          Manualy flushes all log files to disk.
 void logEntry(String entry)
          Creates an entry in the log.
static void setTimeBetweenFlushes(long timeBetweenFlushes)
          Sets the time between global log flushes.
static void shutdown()
          Properly shuts down the log service and flushes all files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log(String logFileName)
Creates a Log object. If this is the first Log object created, the log service is started.

Parameters:
logFileName - Path to the log file.
Method Detail

logEntry

public void logEntry(String entry)
Creates an entry in the log.

Parameters:
entry - Text to add.

flush

public void flush()
Manualy flushes this log file to disk.


flushAll

public static void flushAll()
Manualy flushes all log files to disk.


shutdown

public static void shutdown()
Properly shuts down the log service and flushes all files. Call before terminating your program!


setTimeBetweenFlushes

public static void setTimeBetweenFlushes(long timeBetweenFlushes)
Sets the time between global log flushes.

Parameters:
timeBetweenFlushes - The time in seconds. Zero (0) for manual flushing only.