def py_logger(self):
        """
        Create a logging object we can use to test with.

        @return: a stdlib-style logger
        @rtype: L{StdlibLoggingContainer}
        """
        logger = StdlibLoggingContainer()
        self.addCleanup(logger.close)
        return logger

        Create a logging object we can use to test with.

        @return: a stdlib-style logger
        @rtype: L{StdlibLoggingContainer}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_stdlib.py