util/log: Provide util::log::NO_RATE_LIMIT to avoid rate limits

This commit is contained in:
Anthony Towns
2025-12-08 22:29:39 +10:00
parent 72e92d67df
commit f69d1ae56d
6 changed files with 47 additions and 26 deletions

View File

@@ -2864,8 +2864,8 @@ static void UpdateTipLog(
AssertLockHeld(::cs_main);
// Disable rate limiting in LogPrintLevel_ so this source location may log during IBD.
LogPrintLevel_(BCLog::LogFlags::ALL, util::log::Level::Info, /*should_ratelimit=*/false, "%s%s: new best=%s height=%d version=0x%08x log2_work=%f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)%s\n",
// Disable rate limiting as this may log frequently during IBD.
LogInfo(util::log::NO_RATE_LIMIT, "%s%s: new best=%s height=%d version=0x%08x log2_work=%f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)%s\n",
prefix, func_name,
tip->GetBlockHash().ToString(), tip->nHeight, tip->nVersion,
log(tip->nChainWork.getdouble()) / log(2.0), tip->m_chain_tx_count,