def opt_spew(self):
        """
        Print an insanely verbose log of everything that happens.
        Useful when debugging freezes or locks in complex code.
        """
        sys.settrace(util.spewer)
        try:
            import threading
        except ImportError:
            return
        threading.settrace(util.spewer)

        Print an insanely verbose log of everything that happens.
        Useful when debugging freezes or locks in complex code.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/app.py