HomePhabricator

Add last missing part from PR12954

Description

Add last missing part from PR12954

Summary:
Pull request description:

This is purely a refactor with no behavior changes.

This creates a new class `BCLog::Logger` to encapsulate all global logging configuration and state.

Tree-SHA512: b34811f54a53b7375d7b6f84925453c6f2419d21179379ee28b3843d0f4ff8e22020de84a5e783453ea927e9074e32de8ecd05a6fa50d7bb05502001aaed8e53

Partial backport of Core PR12954
https://github.com/bitcoin/bitcoin/pull/12954/files#diff-d278fc7d6997679f1f7416c5eda758fcR92
https://github.com/bitcoin/bitcoin/pull/12954/files#diff-d278fc7d6997679f1f7416c5eda758fcR147

Most of the changes were already made in various patches over time (see D4531 and D5010 for examples). This is only adding the last missing Enabled() function which will reducing our code ownership and make future backports easier.

Test Plan:

make check
./bitcoind -printtoconsole=0 -debuglogfile=0

Perform some RPC calls and verify no log information is printed.

./bitcoind

Verify logging information is printed to console.

./bitcoind -printtoconsole=0

Verify logging information is printed to the default debug.log file.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

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

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on May 1 2018, 02:13
nakihitoCommitted on Jan 23 2020, 00:17
nakihitoPushed on Jan 23 2020, 00:33
Reviewer
Restricted Owners Package
Differential Revision
D5044: Add last missing part from PR12954
Parents
rSTAGING9b9bfc718f0b: Increase RPC timeout for the feature_assumevalid test
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/15751