def _patchTextFileLogObserver(patch):
    logFiles = []
    oldFileLogObserver = logger.textFileLogObserver

    def observer(logFile, *args, **kwargs):
        logFiles.append(logFile)
        return oldFileLogObserver(logFile, *args, **kwargs)

    patch(logger, 'textFileLogObserver', observer)
    return logFiles
Patch L{logger.textFileLogObserver} to record every call and keep a
dataset/ETHPy150Open twisted/twisted/twisted/test/test_twistd.py/_patchTextFileLogObserver