def publishToNewObserver(observer, eventDict, textFromEventDict):
    """
    Publish an old-style (L{twisted.python.log}) event to a new-style
    (L{twisted.logger}) observer.

    @note: It's possible that a new-style event was sent to a
        L{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 the checks for
        already-defined new-style keys.

    @param observer: A new-style observer to handle this event.
    @type observer: L{ILogObserver}

    @param eventDict: An L{old-style <twisted.python.log>}, log event.
    @type eventDict: L{dict}

    @param textFromEventDict: callable that can format an old-style event as a
        string.  Passed here rather than imported to avoid circular dependency.
    @type textFromEventDict: 1-arg L{callable} taking L{dict} returning L{str}

    @return: L{None}
    """

    if "log_time" not in eventDict:
        eventDict["log_time"] = eventDict["time"]

    if "log_format" not in eventDict:
        text = textFromEventDict(eventDict)
        if text is not None:
            eventDict["log_text"] = text
            eventDict["log_format"] = u"{log_text}"

    if "log_level" not in eventDict:
        if "logLevel" in eventDict:
            try:
                level = fromStdlibLogLevelMapping[eventDict["logLevel"]]
            except __HOLE__:
                level = None
        elif "isError" in eventDict:
            if eventDict["isError"]:
                level = LogLevel.critical
            else:
                level = LogLevel.info
        else:
            level = LogLevel.info

        if level is not None:
            eventDict["log_level"] = level

    if "log_namespace" not in eventDict:
        eventDict["log_namespace"] = u"log_legacy"

    if "log_system" not in eventDict and "system" in eventDict:
        eventDict["log_system"] = eventDict["system"]

    observer(eventDict)
dataset/ETHPy150Open twisted/twisted/twisted/logger/_legacy.py/publishToNewObserver