u.u.UDPLogger(object) : class documentation

Part of udplog.udplog View Source View In Hierarchy

Dispatcher of structured log events over UDP.

Line # Kind Name Docs
92 Method __init__ Undocumented
100 Method augment Augment the event dictionary with timestamp and default fields.
109 Method serialize Serialize a log event.
126 Method serializeFailure Serialize a log event for a failed attempt to send a udplog event.
163 Method log Log an event.
def __init__(self, host=DEFAULT_HOST, port=DEFAULT_PORT, defaultFields=None): (source)
Undocumented
def augment(self, eventDict): (source)

Augment the event dictionary with timestamp and default fields.

def serialize(self, category, eventDict): (source)

Serialize a log event.

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

def serializeFailure(self, category, eventDict, size, failure, why): (source)

Serialize a log event for a failed attempt to send a udplog event.

If present, this truncates the 'message' field to MAX_TRIMMED_MESSAGE_SIZE, and preserves exception-related fields from the original eventDict as 'original'.

def log(self, category, eventDict): (source)

Log an event.

ParameterscategoryA short string identifying the type of log event. The receiving log server may use this to collect all messages of the same category in their own log files. (type: bytes)
eventDictThe event dictionary. As this is serialized to JSON (see serialize), for complex values, you may want to render them to a string before adding them to the event dictionary. (type: dict)
API Documentation for udplog, generated by pydoctor at 2014-02-17 15:26:29.