mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
logging: More fully remove libevent log category
Libevent log category was partially removed in 39e9099da5, and this
commit extends that with the following changes:
- Stops showing libevent in the list of supported log categories in
`bitcoind -help` and `bitcoin-cli help logging` output.
- Stops returning `"libevent": false` in `logging` RPC output.
It's not good to treat libevent as a supported log category when it
can't be enabled and trying to enable it results in warnings.
There's also no need to define an unused LIBEVENT constant value and
keep more complicated logic for dealing with deprecated log categories,
so this change also simplifies code internally.
Co-authored-by: David Gumberg <davidzgumberg@gmail.com>
Co-authored-by: l0rinc <pap.lorinc@gmail.com>
This commit is contained in:
@@ -121,16 +121,17 @@ class RpcMiscTest(BitcoinTestFramework):
|
||||
assert_equal(node.getindexinfo("foo"), {})
|
||||
|
||||
# Test a deprecated category
|
||||
node.logging(include=['all'])
|
||||
for category, value in node.logging().items():
|
||||
# Everything True except one...
|
||||
assert_equal(value, category != "libevent")
|
||||
with self.nodes[0].assert_debug_log(["The logging category `libevent` is deprecated"]):
|
||||
node.logging(include=['libevent'])
|
||||
assert_equal(node.logging()['libevent'], False)
|
||||
with self.nodes[0].assert_debug_log(["The logging category `libevent` is deprecated"]):
|
||||
node.logging(exclude=['libevent'])
|
||||
assert_equal(node.logging()['libevent'], False)
|
||||
all_result = node.logging(include=['all'])
|
||||
assert_equal(True, all(enabled is True for category, enabled in all_result.items()))
|
||||
assert_equal(True, 'libevent' not in all_result)
|
||||
assert_equal(all_result, node.logging())
|
||||
libevent_warning = "The logging category `libevent` is deprecated"
|
||||
with self.nodes[0].assert_debug_log([libevent_warning]):
|
||||
assert_equal(all_result, node.logging(include=['libevent']))
|
||||
assert_equal(all_result, node.logging())
|
||||
with self.nodes[0].assert_debug_log([libevent_warning]):
|
||||
assert_equal(all_result, node.logging(exclude=['libevent']))
|
||||
assert_equal(all_result, node.logging())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user