Package ioids :: Module ioidslogging :: Class FileLogger
[hide private]
[frames] | no frames]

Class FileLogger

source code

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

Addtionally, this class supports logging into syslog facilities.

Instance Methods [hide private]
 
__init__(self)
Open the log file.
source code
 
closedown(self)
Shutdown logging.
source code
 
newMessage(self, category, message)
New entry for the log system.
source code
List of String
getLatestMessages(self, n)
Returns the last 'n' lines of the log file.
source code
Instance Variables [hide private]
int _level
Log level to be used for the instance (defined in config file)
File _logfile
Reference to the file instance
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Open the log file.

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

closedown(self)

source code 

Shutdown logging.

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

newMessage(self, category, message)

source code 

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.

getLatestMessages(self, n)

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