Home | Trees | Index | Help |
|
---|
|
Filterer --+ | Handler --+ | NTEventLogHandler
Method Summary | |
---|---|
__init__(self, appname, dllname, logtype) | |
close(self)
Clean up this handler. | |
emit(self,
record)
Emit a record. | |
getEventCategory(self,
record)
Return the event category for the record. | |
getEventType(self,
record)
Return the event type for the record. | |
getMessageID(self,
record)
Return the message ID for the event record. | |
Inherited from Handler | |
acquire(self)
Acquire the I/O thread lock. | |
createLock(self)
Acquire a thread lock for serializing access to the underlying I/O. | |
flush(self)
Ensure all logging output has been flushed. | |
format(self,
record)
Format the specified record. | |
handle(self,
record)
Conditionally emit the specified logging record. | |
handleError(self,
record)
Handle errors which occur during an emit() call. | |
release(self)
Release the I/O thread lock. | |
setFormatter(self,
fmt)
Set the formatter for this handler. | |
setLevel(self,
level)
Set the logging level of this handler. | |
Inherited from Filterer | |
addFilter(self,
filter)
Add the specified filter to this handler. | |
filter(self,
record)
Determine if a record is loggable by consulting all the filters. | |
removeFilter(self,
filter)
Remove the specified filter from this handler. |
Method Details |
---|
__init__(self,
appname,
dllname=None,
logtype='Application')
|
close(self)Clean up this handler. You can remove the application name from the registry as a source of event log entries. However, if you do this, you will not be able to see the events as you intended in the Event Log Viewer - it needs to be able to access the registry to get the DLL name.
|
emit(self, record)Emit a record. Determine the message ID, event category and event type. Then log the message in the NT event log.
|
getEventCategory(self, record)Return the event category for the record. Override this if you want to specify your own categories. This version returns 0. |
getEventType(self, record)Return the event type for the record. Override this if you want to specify your own types. This version does a mapping using the handler's typemap attribute, which is set up in __init__() to a dictionary which contains mappings for DEBUG, INFO, WARNING, ERROR and CRITICAL. If you are using your own levels you will either need to override this method or place a suitable dictionary in the handler's typemap attribute. |
getMessageID(self, record)Return the message ID for the event record. If you are using your own messages, you could do this by having the msg passed to the logger being an ID rather than a formatting string. Then, in here, you could use a dictionary lookup to get the message ID. This version returns 1, which is the base message ID in win32service.pyd. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Oct 13 20:20:57 2005 | http://epydoc.sf.net |