mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
bench: allow logging benchmarks to be order-independent
The global logging object instance is not re-created for each run, so when multiple logging benchmarks are run, each one after the first one still has the logging categories enabled from the previous ones. This commit disables all categories at the start of each benchmark.
This commit is contained in:
parent
a62231bca6
commit
4684aa8733
1 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,9 @@
|
|||
|
||||
static void Logging(benchmark::Bench& bench, const std::vector<const char*>& extra_args, const std::function<void()>& log)
|
||||
{
|
||||
// Reset any enabled logging categories from a previous benchmark run.
|
||||
LogInstance().DisableCategory(BCLog::LogFlags::ALL);
|
||||
|
||||
TestingSetup test_setup{
|
||||
CBaseChainParams::REGTEST,
|
||||
extra_args,
|
||||
|
|
Loading…
Add table
Reference in a new issue