def emit(self, record):
        """
        Emit a record.
        """
        try:
            eventDict = {
                    'category': self.category,
                    'logLevel': record.levelname,
                    'logName': record.name,
                    'filename': record.pathname,
                    'lineno': record.lineno,
                    'funcName': record.funcName,
                    }

            eventDict['isError'] = record.levelno >= logging.ERROR

            if isinstance(record.args, dict):
                eventDict.update(record.args)

            message = record.getMessage()

            if record.exc_info:
                exc_type, exc_value, exc_traceback = record.exc_info
                eventDict['failure'] = Failure(exc_value,
                                               exc_type,
                                               exc_traceback)
                self.publisher.msg(why=message, **eventDict)
            else:
                self.publisher.msg(message, **eventDict)

        except (KeyboardInterrupt, __HOLE__):
            raise
        except:
            self.handleError(record)
dataset/ETHPy150Open mochi/udplog/udplog/twisted.py/TwistedLogHandler.emit