def redirectToLogPublisher(self):
        written = []
        publisher = LogPublisher()
        publisher.addObserver(lambda m: written.append(textFromEventDict(m)))
        destination = _RedirectLogsForTrial(FakeSys(["trial"], b""), publisher)()
        self.addCleanup(removeDestination, destination)
        return written
Redirect Eliot logs to a Twisted log publisher.
dataset/ETHPy150Open ClusterHQ/eliot/eliot/tests/test_twisted.py/RedirectLogsForTrialTests.redirectToLogPublisher