webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | List of all members
compat_logging.handlers.NTEventLogHandler Class Reference
Inheritance diagram for compat_logging.handlers.NTEventLogHandler:

Public Member Functions

def __init__ (self, appname, dllname=None, logtype="Application")
 
def getMessageID (self, record)
 
def getEventCategory (self, record)
 
def getEventType (self, record)
 
def emit (self, record)
 
def close (self)
 

Public Attributes

 appname
 
 dllname
 
 logtype
 
 deftype
 
 typemap
 

Detailed Description

A handler class which sends events to the NT Event Log. Adds a
registry entry for the specified application name. If no dllname is
provided, win32service.pyd (which contains some basic message
placeholders) is used. Note that use of these placeholders will make
your event logs big, as the entire message source is held in the log.
If you want slimmer logs, you have to pass in the name of your own DLL
which contains the message definitions you want to use in the event log.

Constructor & Destructor Documentation

◆ __init__()

def compat_logging.handlers.NTEventLogHandler.__init__ (   self,
  appname,
  dllname = None,
  logtype = "Application" 
)

Member Function Documentation

◆ close()

def compat_logging.handlers.NTEventLogHandler.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()

def compat_logging.handlers.NTEventLogHandler.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()

def compat_logging.handlers.NTEventLogHandler.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()

def compat_logging.handlers.NTEventLogHandler.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()

def compat_logging.handlers.NTEventLogHandler.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.

Member Data Documentation

◆ appname

compat_logging.handlers.NTEventLogHandler.appname

◆ deftype

compat_logging.handlers.NTEventLogHandler.deftype

◆ dllname

compat_logging.handlers.NTEventLogHandler.dllname

◆ logtype

compat_logging.handlers.NTEventLogHandler.logtype

◆ typemap

compat_logging.handlers.NTEventLogHandler.typemap

The documentation for this class was generated from the following file: