irssibot.util.log
Class FileLog

java.lang.Object
  |
  +--irssibot.util.log.FileLog
All Implemented Interfaces:
CommonLog

public class FileLog
extends java.lang.Object
implements CommonLog

Logger for file based logging.

Version:
$Name: $ $Revision: 1.3 $
Author:
Matti Dahlbom

Field Summary
private  java.io.BufferedOutputStream out
          Output stream for current log file
private  java.util.Properties properties
          Init properties
 
Fields inherited from interface irssibot.util.log.CommonLog
PROPERTY_FILE_PATH_PROPERTY_NAME
 
Constructor Summary
FileLog()
          Constructs.
 
Method Summary
 java.lang.String getPropertyFilePath()
          Returns path for property file from which this CommonLog was initialized.
 void init(java.util.Properties properties)
          Initializes this logger.
 void logMessage(java.lang.String message)
          Logs a preformatted log message to file, appending a line break character \n.
 void stop()
          Stops and deinits this logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.io.BufferedOutputStream out
Output stream for current log file


properties

private java.util.Properties properties
Init properties

Constructor Detail

FileLog

public FileLog()
Constructs.

Method Detail

getPropertyFilePath

public java.lang.String getPropertyFilePath()
Returns path for property file from which this CommonLog was initialized.

Specified by:
getPropertyFilePath in interface CommonLog
Returns:
path to property file

logMessage

public void logMessage(java.lang.String message)
                throws LogException
Logs a preformatted log message to file, appending a line break character \n.

Specified by:
logMessage in interface CommonLog
Parameters:
message - log message to write
Throws:
LogException - if there is an error writing to file

init

public void init(java.util.Properties properties)
Initializes this logger. Opens output stream to a new log file, creating the file.

Specified by:
init in interface CommonLog
Parameters:
properties - init properties, or null if none supplied

stop

public void stop()
Stops and deinits this logger. Closes the log file.

Specified by:
stop in interface CommonLog


IrssiBot (c) 2000-2002 Matti Dahlbom