Skip to content

Commit b175bdb

Browse files
committed
Merge bitcoin/bitcoin#27238: refactor: Split logging utilities from system.h
aaced56 refactor: Move error() from util/system.h to logging.h (Ben Woosley) e7333b4 refactor: Extract util/exception from util/system (Ben Woosley) Pull request description: This pull request is part of the `libbitcoinkernel` project bitcoin/bitcoin#24303 https://github.com/bitcoin/bitcoin/projects/18 and more specifically its "Step 2: Decouple most non-consensus code from libbitcoinkernel". These commits were originally authored by empact and are taken from their parent PR #25152. #### Context There is an ongoing effort to decouple the `ArgsManager` used for command line parsing user-provided arguments from the libbitcoinkernel library (bitcoin/bitcoin#25290, bitcoin/bitcoin#25487, bitcoin/bitcoin#25527, bitcoin/bitcoin#25862, bitcoin/bitcoin#26177, and bitcoin/bitcoin#27125). The `ArgsManager` is defined in `system.h`. #### Changes Next to providing better code organization, this PR removes some reliance of the tree of libbitcoinkernel header includes on `system.h` (and thus the `ArgsManager` definition) by moving some logging functions out of the `system.*` files. Further commits splitting more functionality out of `system.h` are still in #25152 and will be submitted in separate PRs once this PR has been processed. ACKs for top commit: MarcoFalke: re-ACK aaced56 🐍 Tree-SHA512: cb39f4cb7a77e7dc1887b1cbf340d53decab8880fc00878a2f12dc627fe67245b4aafd4cc31a9eab0fad1e5bb5d0eb4cdb8d501323ca200fa6ab7b201ae34aea
2 parents f50fb17 + aaced56 commit b175bdb

26 files changed

+87
-42
lines changed

ci/test/06_script_b.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
6969
" src/util/bytevectorhash.cpp"\
7070
" src/util/check.cpp"\
7171
" src/util/error.cpp"\
72+
" src/util/exception.cpp"\
7273
" src/util/getuniquepath.cpp"\
7374
" src/util/hasher.cpp"\
7475
" src/util/message.cpp"\

src/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ BITCOIN_CORE_H = \
279279
util/check.h \
280280
util/epochguard.h \
281281
util/error.h \
282+
util/exception.h \
282283
util/fastrange.h \
283284
util/fees.h \
284285
util/getuniquepath.h \
@@ -699,6 +700,7 @@ libbitcoin_util_a_SOURCES = \
699700
util/bytevectorhash.cpp \
700701
util/check.cpp \
701702
util/error.cpp \
703+
util/exception.cpp \
702704
util/fees.cpp \
703705
util/getuniquepath.cpp \
704706
util/hasher.cpp \
@@ -942,6 +944,7 @@ libbitcoinkernel_la_SOURCES = \
942944
txmempool.cpp \
943945
uint256.cpp \
944946
util/check.cpp \
947+
util/exception.cpp \
945948
util/getuniquepath.cpp \
946949
util/hasher.cpp \
947950
util/moneystr.cpp \

src/addrdb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <cstdint>
1212
#include <fs.h>
1313
#include <hash.h>
14+
#include <logging.h>
1415
#include <logging/timer.h>
1516
#include <netbase.h>
1617
#include <netgroup.h>

src/bitcoin-cli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <rpc/request.h>
2020
#include <tinyformat.h>
2121
#include <univalue.h>
22+
#include <util/exception.h>
2223
#include <util/strencodings.h>
2324
#include <util/system.h>
2425
#include <util/translation.h>

src/bitcoin-tx.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
#include <consensus/amount.h>
1313
#include <consensus/consensus.h>
1414
#include <core_io.h>
15-
#include <key_io.h>
1615
#include <fs.h>
16+
#include <key_io.h>
1717
#include <policy/policy.h>
1818
#include <primitives/transaction.h>
1919
#include <script/script.h>
2020
#include <script/sign.h>
2121
#include <script/signingprovider.h>
2222
#include <univalue.h>
23+
#include <util/exception.h>
2324
#include <util/moneystr.h>
2425
#include <util/rbf.h>
2526
#include <util/strencodings.h>

src/bitcoin-util.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <compat/compat.h>
1515
#include <core_io.h>
1616
#include <streams.h>
17+
#include <util/exception.h>
1718
#include <util/system.h>
1819
#include <util/translation.h>
1920
#include <version.h>

src/bitcoin-wallet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <logging.h>
1717
#include <pubkey.h>
1818
#include <tinyformat.h>
19+
#include <util/exception.h>
1920
#include <util/system.h>
2021
#include <util/translation.h>
2122
#include <wallet/wallettool.h>

src/bitcoind.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <noui.h>
2121
#include <shutdown.h>
2222
#include <util/check.h>
23+
#include <util/exception.h>
2324
#include <util/strencodings.h>
2425
#include <util/syscall_sandbox.h>
2526
#include <util/syserror.h>

src/index/base.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <index/base.h>
77
#include <interfaces/chain.h>
88
#include <kernel/chain.h>
9+
#include <logging.h>
910
#include <node/blockstorage.h>
1011
#include <node/context.h>
1112
#include <node/database_args.h>

src/index/coinstatsindex.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <crypto/muhash.h>
88
#include <index/coinstatsindex.h>
99
#include <kernel/coinstats.h>
10+
#include <logging.h>
1011
#include <node/blockstorage.h>
1112
#include <serialize.h>
1213
#include <txdb.h>

0 commit comments

Comments
 (0)