module documentation
(source)

Integration with twisted.python.log.

Function publishToNewObserver Publish an old-style (twisted.python.log) event to a new-style (twisted.logger) observer.
def publishToNewObserver(observer, eventDict, textFromEventDict): (source)

Publish an old-style (twisted.python.log) event to a new-style (twisted.logger) observer.

ParametersobserverA new-style observer to handle this event. (type: ILogObserver)
eventDictAn old-style, log event. (type: Dict[str, Any])
textFromEventDictcallable that can format an old-style event as a string. Passed here rather than imported to avoid circular dependency. (type: Callable[[Dict[str, Any]], Optional[str]])
NoteIt's possible that a new-style event was sent to a LegacyLogObserverWrapper, and may now be getting sent back to a new-style observer. In this case, it's already a new-style event, adapted to also look like an old-style event, and we don't need to tweak it again to be a new-style event, hence this checks for already-defined new-style keys.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.