'Emit a record.
Determine the message ID, event category and event type. Then
log the message in the NT event log.'

def emit(self, record):

    if self._welu:
        try:
            id = self.getMessageID(record)
            cat = self.getEventCategory(record)
            type = self.getEventType(record)
            msg = self.format(record)
            self._welu.ReportEvent(self.appname, id, cat, type, [msg])
        except Exception:
            self.handleError(record)
