log: [refactor] Use info level for init logs

This refactor does not change behavior.
This commit is contained in:
MarcoFalke
2025-07-25 09:52:43 +02:00
parent fa183761cb
commit face8123fd
27 changed files with 106 additions and 102 deletions

View File

@@ -298,7 +298,7 @@ void BlockManager::FindFilesToPruneManual(
setFilesToPrune.insert(fileNumber);
count++;
}
LogPrintf("[%s] Prune (Manual): prune_height=%d removed %d blk/rev pairs\n",
LogInfo("[%s] Prune (Manual): prune_height=%d removed %d blk/rev pairs",
chain.GetRole(), last_block_can_prune, count);
}
@@ -418,7 +418,7 @@ bool BlockManager::LoadBlockIndex(const std::optional<uint256>& snapshot_blockha
// to disk, we must bootstrap the value for assumedvalid chainstates
// from the hardcoded assumeutxo chainparams.
base->m_chain_tx_count = au_data.m_chain_tx_count;
LogPrintf("[snapshot] set m_chain_tx_count=%d for %s\n", au_data.m_chain_tx_count, snapshot_blockhash->ToString());
LogInfo("[snapshot] set m_chain_tx_count=%d for %s", au_data.m_chain_tx_count, snapshot_blockhash->ToString());
} else {
// If this isn't called with a snapshot blockhash, make sure the cached snapshot height
// is null. This is relevant during snapshot completion, when the blockman may be loaded
@@ -523,7 +523,7 @@ bool BlockManager::LoadBlockIndexDB(const std::optional<uint256>& snapshot_block
}
// Check presence of blk files
LogPrintf("Checking all blk files are present...\n");
LogInfo("Checking all blk files are present...");
std::set<int> setBlkDataFiles;
for (const auto& [_, block_index] : m_block_index) {
if (block_index.nStatus & BLOCK_HAVE_DATA) {
@@ -622,7 +622,7 @@ void BlockManager::CleanupBlockRevFiles() const
// Glob all blk?????.dat and rev?????.dat files from the blocks directory.
// Remove the rev files immediately and insert the blk file paths into an
// ordered map keyed by block file index.
LogPrintf("Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune\n");
LogInfo("Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune");
for (fs::directory_iterator it(m_opts.blocks_dir); it != fs::directory_iterator(); it++) {
const std::string path = fs::PathToString(it->path().filename());
if (fs::is_regular_file(*it) &&
@@ -1233,7 +1233,7 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
if (file.IsNull()) {
break; // This error is logged in OpenBlockFile
}
LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
LogInfo("Reindexing block file blk%05u.dat...", (unsigned int)nFile);
chainman.LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
if (chainman.m_interrupt) {
LogInfo("Interrupt requested. Exit reindexing.");
@@ -1243,7 +1243,7 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
}
WITH_LOCK(::cs_main, chainman.m_blockman.m_block_tree_db->WriteReindexing(false));
chainman.m_blockman.m_blockfiles_indexed = true;
LogPrintf("Reindexing finished\n");
LogInfo("Reindexing finished");
// To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
chainman.ActiveChainstate().LoadGenesisBlock();
}
@@ -1252,7 +1252,7 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
for (const fs::path& path : import_paths) {
AutoFile file{fsbridge::fopen(path, "rb")};
if (!file.IsNull()) {
LogPrintf("Importing blocks file %s...\n", fs::PathToString(path));
LogInfo("Importing blocks file %s...", fs::PathToString(path));
chainman.LoadExternalBlockFile(file);
if (chainman.m_interrupt) {
LogInfo("Interrupt requested. Exit block importing.");