'If the factory is initialized with a custom log formatter then that
formatter is used to generate lines for the log file.'

def test_logFormatOverride(self):

    def notVeryGoodFormatter(timestamp, request):
        return u'this    is    a    bad    log    format'
    reactor = Clock()
    reactor.advance(1234567890)
    logPath = self.mktemp()
    factory = self.factory(logPath=logPath, logFormatter=notVeryGoodFormatter)
    factory._reactor = reactor
    factory.startFactory()
    try:
        factory.log(DummyRequestForLogTest(factory))
    finally:
        factory.stopFactory()
    self.assertEqual('this    is    a    bad    log    format\n', FilePath(logPath).getContent())
