Package g4ds :: Module g4dslogging :: Class FileLogger
[show private | hide private]
[frames | no frames]

Class FileLogger


All messages are equipped with a timestamp and line wise written to a log file.

Addtionally, this class supports logging into syslog facilities.
Method Summary
  __init__(self)
Open the log file.
  closedown(self)
Shutdown logging.
List of String getLatestMessages(self, n)
Returns the last 'n' lines of the log file.
  newMessage(self, category, message)
New entry for the log system.

Instance Variable Summary
int _level: Log level to be used for the instance (defined in config file)
File _logfile: Reference to the file instance

Method Details

__init__(self)
(Constructor)

Open the log file.

Put a log message in the log file for brining up the g4ds log service.

closedown(self)

Shutdown logging.

Put a log message in the log file for closing down g4ds logging and finally close the log file.

getLatestMessages(self, n)

Returns the last 'n' lines of the log file.
Parameters:
n - Number of lines requested
           (type=int)
Returns:
The last lines - each line as a string - together in a list
           (type=List of String)

newMessage(self, category, message)

New entry for the log system.

A check is performed, whether the given category is to be logged in the activated log level. If so, a message is generated, made up by a time stamp, the category value and the message itself.

Instance Variable Details

_level

Log level to be used for the instance (defined in config file)
Type:
int

_logfile

Reference to the file instance
Type:
File

Generated by Epydoc 2.0 on Sat Oct 22 22:52:47 2005 http://epydoc.sf.net