def _setupSyslog(testCase):
    logMessages = []

    class fakesyslogobserver(object):
        def __init__(self, prefix):
            logMessages.append(prefix)

        def emit(self, eventDict):
            logMessages.append(eventDict)

    testCase.patch(syslog, "SyslogObserver", fakesyslogobserver)
    return logMessages
Make fake syslog, and return list to which prefix and then log
dataset/ETHPy150Open twisted/twisted/twisted/test/test_twistd.py/_setupSyslog