HomePhabricator

Add closing and flushing of logging handlers

Description

Add closing and flushing of logging handlers

Summary:

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.

This is a backport of Core PR17288 [3/8]
https://github.com/bitcoin/bitcoin/pull/17288/commits/6f40820757d25ff1ccfdfcbdf2b45b8b65308010

Depends on D8242

Test Plan: ninja && ninja check

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D8243

Details

Provenance
JamesC <james.chiangwu@gmail.com>Authored on Nov 3 2020, 13:28
PiRKCommitted on Nov 3 2020, 13:28
abc-botPushed on Nov 3 2020, 13:33
Reviewer
Restricted Owners Package
Differential Revision
D8243: Add closing and flushing of logging handlers
Parents
rABCe80d5b9ce1e7: Refactor TestFramework main() into setup/shutdown
Branches
Unknown
Tags
Unknown