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,
                    'timestamp': record.created,
                    }

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

            extra = {name: value for name, value in vars(record).iteritems()
                     if name not in _DEFAULT_LOGGING_ATTRIBUTES}

            eventDict.update(extra)

            # Format the message for its side effects and extract the message
            # and exception information
            self.format(record)
            eventDict['message'] = record.message
            if record.exc_info:
                excType, excValue = record.exc_info[0:2]
                eventDict['excValue'] = reflect.safe_str(excValue)
                if excValue is None:
                    eventDict['excText'] = None
                    eventDict['excType'] = 'NoneType'
                else:
                    eventDict['excText'] = record.exc_text
                    eventDict['excType'] = reflect.qual(excType)

            # Extract the category, possibly overridden from record.args.
            category =  eventDict['category']
            del eventDict['category']


            self.logger.log(category, eventDict)
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
dataset/ETHPy150Open mochi/udplog/udplog/udplog.py/UDPLogHandler.emit/original