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:
Larry Ruane 2023-01-30 07:21:36 -08:00 committed by Jon Atack
parent a62231bca6
commit 4684aa8733
1 changed files with 3 additions and 0 deletions

View File

@ -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,