Tools for formatting logging events.

Function formatUnformattableEvent Formats an event as a unicode that describes the event generically and a formatting error.
Class CallMapping Read-only mapping that turns a ()-suffix in key names into an invocation of the key rather than a lookup of the key.
Function formatWithCall Format a string like unicode.format, but:
def formatUnformattableEvent(event, error): (source)

Formats an event as a unicode that describes the event generically and a formatting error.

ParameterseventA logging event. (type: dict)
errorThe formatting error. (type: Exception)
ReturnsA formatted string. (type: unicode)
def formatWithCall(formatString, mapping): (source)

Format a string like unicode.format, but:

  • taking only a name mapping; no positional arguments
  • with the additional syntax that an empty set of parentheses correspond to a formatting item that should be called, and its result str'd, rather than calling str on the element directly as normal.

For example:

   >>> formatWithCall("{string}, {function()}.",
   ...                dict(string="just a string",
   ...                     function=lambda: "a function"))
   'just a string, a function.'
ParametersformatStringA PEP-3101 format string. (type: unicode)
mappingA dict-like object to format.
ReturnsThe string with formatted values interpolated. (type: unicode)
API Documentation for Twisted, generated by pydoctor at 2017-09-23 19:45:03.