def serialize(self, category, eventDict):
        """
        Serialize a log event.

        The dictionary is serialized to JSON. To minimize serialization
        failures, for unserializable objects it falls back to the L{repr} of
        such objects.

        @type category: L{str}
        @type eventDict: L{dict}
        """
        msg = simplejson.dumps(eventDict,
                               default=lambda x: str(repr(x)),
                               skipkeys=True)
        return "%s:\t%s" % (category, msg)
dataset/ETHPy150Open mochi/udplog/udplog/udplog.py/UDPLogger.serialize/original