def setUp(self):
        """
        Override L{globaLogBeginner.beginLoggingTo} so that we can trace the
        observers installed in C{self.observers}.
        """
        self.observers = []

        def beginLoggingTo(observers):
            for observer in observers:
                self.observers.append(observer)
                globalLogPublisher.addObserver(observer)

        self.patch(globalLogBeginner, 'beginLoggingTo', beginLoggingTo)

        Override L{globaLogBeginner.beginLoggingTo} so that we can trace the
        observers installed in C{self.observers}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py