In order for BitcoinTestFramework to correctly restart after shutdown, the
previous logging handlers need to be removed, or else logging will continue in
the previous temp directory. "Flush" ensures buffers are emptied, and "close"
ensures file handler close logging file.
@ -266,7 +266,18 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
self.log.error("Test failed. Test logging available at %s/test_framework.log",self.options.tmpdir)
self.log.error("Test failed. Test logging available at %s/test_framework.log",self.options.tmpdir)
self.log.error("Hint: Call {}'{}' to consolidate all logs".format(os.path.normpath(os.path.dirname(os.path.realpath(__file__))+"/../combine_logs.py"),self.options.tmpdir))
self.log.error("Hint: Call {}'{}' to consolidate all logs".format(os.path.normpath(os.path.dirname(os.path.realpath(__file__))+"/../combine_logs.py"),self.options.tmpdir))
exit_code=TEST_EXIT_FAILED
exit_code=TEST_EXIT_FAILED
logging.shutdown()
# Logging.shutdown will not remove stream- and filehandlers, so we must
# do it explicitly. Handlers are removed so the next test run can apply