diff --git a/src/init.cpp b/src/init.cpp index 63244c802ea..aa5ac48cd3f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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"); } /** diff --git a/src/init/common.cpp b/src/init/common.cpp index 7191854c747..164d735d07c 100644 --- a/src/init/common.cpp +++ b/src/init/common.cpp @@ -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())); diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 4f6a4977bdb..98631ce4b45 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -508,11 +508,11 @@ bool BlockManager::LoadBlockIndexDB(const std::optional& 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& 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 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 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 { diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index c88bd5bad23..5e271cfd615 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -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); } diff --git a/src/validation.cpp b/src/validation.cpp index 7992b857129..1515ab66c55 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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; } diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 9ac90cecd5c..d68a4b6984b 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -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; diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py index f8323454d78..76c79fe0036 100755 --- a/test/functional/feature_pruning.py +++ b/test/functional/feature_pruning.py @@ -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}")