def emit(self, eventDict):
        """
        Format the given log event as text and write it to the output file.

        @param eventDict: a log event
        @type eventDict: L{dict} mapping L{str} (native string) to L{object}
        """
        text = textFromEventDict(eventDict)
        if text is None:
            return

        timeStr = self.formatTime(eventDict["time"])
        fmtDict = {
            "system": eventDict["system"],
            "text": text.replace("\n", "\n\t")
        }
        msgStr = _safeFormat("[%(system)s] %(text)s\n", fmtDict)

        util.untilConcludes(self.write, timeStr + " " + msgStr)
        util.untilConcludes(self.flush)  # Hoorj!

        Format the given log event as text and write it to the output file.

        @param eventDict: a log event
        @type eventDict: L{dict} mapping L{str} (native string) to L{object}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/log.py