log: Remove function name from init logs

It is redundant with -logsourcelocations and the log messages are
clearer without it.

Also, remove a double-space.

Also, add braces around `if` touched in the next commit.

This tiny behavior change requires a test fixup.
This commit is contained in:
MarcoFalke 2025-07-24 16:28:56 +02:00
parent e17fb86382
commit fa183761cb
No known key found for this signature in database
7 changed files with 14 additions and 13 deletions

View File

@ -284,7 +284,7 @@ void Shutdown(NodeContext& node)
static Mutex g_shutdown_mutex;
TRY_LOCK(g_shutdown_mutex, lock_shutdown);
if (!lock_shutdown) return;
LogPrintf("%s: In progress...\n", __func__);
LogInfo("Shutdown in progress...");
Assert(node.args);
/// Note: Shutdown() must be able to handle cases in which initialization failed part of the way,
@ -395,7 +395,7 @@ void Shutdown(NodeContext& node)
RemovePidFile(*node.args);
LogPrintf("%s: done\n", __func__);
LogInfo("Shutdown done");
}
/**

View File

@ -114,8 +114,9 @@ bool StartLogging(const ArgsManager& args)
fs::PathToString(LogInstance().m_file_path))));
}
if (!LogInstance().m_log_timestamps)
if (!LogInstance().m_log_timestamps) {
LogPrintf("Startup time: %s\n", FormatISO8601DateTime(GetTime()));
}
LogPrintf("Default data directory %s\n", fs::PathToString(GetDefaultDataDir()));
LogPrintf("Using data directory %s\n", fs::PathToString(gArgs.GetDataDirNet()));

View File

@ -508,11 +508,11 @@ bool BlockManager::LoadBlockIndexDB(const std::optional<uint256>& snapshot_block
// Load block file info
m_block_tree_db->ReadLastBlockFile(max_blockfile_num);
m_blockfile_info.resize(max_blockfile_num + 1);
LogPrintf("%s: last block file = %i\n", __func__, max_blockfile_num);
LogInfo("Loading block index db: last block file = %i", max_blockfile_num);
for (int nFile = 0; nFile <= max_blockfile_num; nFile++) {
m_block_tree_db->ReadBlockFileInfo(nFile, m_blockfile_info[nFile]);
}
LogPrintf("%s: last block file info: %s\n", __func__, m_blockfile_info[max_blockfile_num].ToString());
LogInfo("Loading block index db: last block file info: %s", m_blockfile_info[max_blockfile_num].ToString());
for (int nFile = max_blockfile_num + 1; true; nFile++) {
CBlockFileInfo info;
if (m_block_tree_db->ReadBlockFileInfo(nFile, info)) {
@ -549,7 +549,7 @@ bool BlockManager::LoadBlockIndexDB(const std::optional<uint256>& snapshot_block
// Check whether we have ever pruned block & undo files
m_block_tree_db->ReadFlag("prunedblockfiles", m_have_pruned);
if (m_have_pruned) {
LogPrintf("LoadBlockIndexDB(): Block files have previously been pruned\n");
LogInfo("Loading block index db: Block files have previously been pruned");
}
// Check whether we need to continue reindexing
@ -1236,7 +1236,7 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
chainman.LoadExternalBlockFile(file, &pos, &blocks_with_unknown_parent);
if (chainman.m_interrupt) {
LogPrintf("Interrupt requested. Exit %s\n", __func__);
LogInfo("Interrupt requested. Exit reindexing.");
return;
}
nFile++;
@ -1255,7 +1255,7 @@ void ImportBlocks(ChainstateManager& chainman, std::span<const fs::path> import_
LogPrintf("Importing blocks file %s...\n", fs::PathToString(path));
chainman.LoadExternalBlockFile(file);
if (chainman.m_interrupt) {
LogPrintf("Interrupt requested. Exit %s\n", __func__);
LogInfo("Interrupt requested. Exit block importing.");
return;
}
} else {

View File

@ -154,7 +154,7 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
LogPrintf("Warning: nMinimumChainWork set below default value of %s\n", chainman.GetConsensus().nMinimumChainWork.GetHex());
}
if (chainman.m_blockman.GetPruneTarget() == BlockManager::PRUNE_TARGET_MANUAL) {
LogPrintf("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.\n");
LogInfo("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.");
} else if (chainman.m_blockman.GetPruneTarget()) {
LogPrintf("Prune configured to target %u MiB on disk for block and undo files.\n", chainman.m_blockman.GetPruneTarget() / 1024 / 1024);
}

View File

@ -4768,7 +4768,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
if ((chainstate.m_blockman.IsPruneMode() || is_snapshot_cs) && !(pindex->nStatus & BLOCK_HAVE_DATA)) {
// If pruning or running under an assumeutxo snapshot, only go
// back as far as we have data.
LogPrintf("VerifyDB(): block verification stopping at height %d (no data). This could be due to pruning or use of an assumeutxo snapshot.\n", pindex->nHeight);
LogInfo("Block verification stopping at height %d (no data). This could be due to pruning or use of an assumeutxo snapshot.", pindex->nHeight);
skipped_no_block_data = true;
break;
}

View File

@ -88,14 +88,14 @@ bool WalletInit::ParameterInteraction() const
{
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) {
for (const std::string& wallet : gArgs.GetArgs("-wallet")) {
LogPrintf("%s: parameter interaction: -disablewallet -> ignoring -wallet=%s\n", __func__, wallet);
LogInfo("Parameter interaction: -disablewallet -> ignoring -wallet=%s", wallet);
}
return true;
}
if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg("-walletbroadcast", false)) {
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
LogInfo("Parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0");
}
return true;

View File

@ -225,7 +225,7 @@ class PruneTest(BitcoinTestFramework):
def reorg_back(self):
# Verify that a block on the old main chain fork has been pruned away
assert_raises_rpc_error(-1, "Block not available (pruned data)", self.nodes[2].getblock, self.forkhash)
with self.nodes[2].assert_debug_log(expected_msgs=['block verification stopping at height', '(no data)']):
with self.nodes[2].assert_debug_log(expected_msgs=["Block verification stopping at height", "(no data)"]):
assert not self.nodes[2].verifychain(checklevel=4, nblocks=0)
self.log.info(f"Will need to redownload block {self.forkheight}")