Format an event as a unicode string. Optionally, attach timestamp, traceback, and system information.

The full output format is: u"{timeStamp} [{system}] {event}\n{traceback}\n" where:

  • timeStamp is the event's "log_time" value formatted with the provided formatTime callable.
  • system is the event's "log_system" value, if set, otherwise, the "log_namespace" and "log_level", joined by a u"#". Each defaults to u"-" is not set.
  • event is the event, as formatted by formatEvent.
  • traceback is the traceback if the event contains a "log_failure" key. In the event the original traceback cannot be formatted, a message indicating the failure will be substituted.

If the event cannot be formatted, and no traceback exists, an empty string is returned, even if includeSystem or includeTimestamp are true.

ParameterseventA logging event. (type: dict)
includeTracebackIf true and a "log_failure" key exists, append a traceback. (type: bool)
includeTimestampIf true include a formatted timestamp before the event. (type: bool)
includeSystemIf true, include the event's "log_system" value. (type: bool)
formatTimeA time formatter (type: callable that takes an event argument and returns a unicode)
ReturnsA formatted string with specified options. (type: unicode)
Present SinceTwisted 18.9.0
API Documentation for Twisted, generated by pydoctor at 2018-10-15 19:29:43.