mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-05 13:17:49 +02:00
log: [refactor] Use info level for init logs
This refactor does not change behavior.
This commit is contained in:
34
src/init.cpp
34
src/init.cpp
@@ -898,7 +898,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
|
||||
// on the command line or in this chain's section of the config file.
|
||||
ChainType chain = args.GetChainType();
|
||||
if (chain == ChainType::SIGNET) {
|
||||
LogPrintf("Signet derived magic (message start): %s\n", HexStr(chainparams.MessageStart()));
|
||||
LogInfo("Signet derived magic (message start): %s", HexStr(chainparams.MessageStart()));
|
||||
}
|
||||
bilingual_str errors;
|
||||
for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) {
|
||||
@@ -1234,7 +1234,9 @@ static ChainstateLoadResult InitAndLoadChainstate(
|
||||
if (!mempool_error.empty()) {
|
||||
return {ChainstateLoadStatus::FAILURE_FATAL, mempool_error};
|
||||
}
|
||||
LogPrintf("* Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)\n", cache_sizes.coins * (1.0 / 1024 / 1024), mempool_opts.max_size_bytes * (1.0 / 1024 / 1024));
|
||||
LogInfo("* Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)",
|
||||
cache_sizes.coins * (1.0 / 1024 / 1024),
|
||||
mempool_opts.max_size_bytes * (1.0 / 1024 / 1024));
|
||||
ChainstateManager::Options chainman_opts{
|
||||
.chainparams = chainparams,
|
||||
.datadir = args.GetDataDirNet(),
|
||||
@@ -1274,10 +1276,10 @@ static ChainstateLoadResult InitAndLoadChainstate(
|
||||
// libbitcoinkernel.
|
||||
chainman.snapshot_download_completed = [&node]() {
|
||||
if (!node.chainman->m_blockman.IsPruneMode()) {
|
||||
LogPrintf("[snapshot] re-enabling NODE_NETWORK services\n");
|
||||
LogInfo("[snapshot] re-enabling NODE_NETWORK services");
|
||||
node.connman->AddLocalServices(NODE_NETWORK);
|
||||
}
|
||||
LogPrintf("[snapshot] restarting indexes\n");
|
||||
LogInfo("[snapshot] restarting indexes");
|
||||
// Drain the validation interface queue to ensure that the old indexes
|
||||
// don't have any pending work.
|
||||
Assert(node.validation_signals)->SyncWithValidationInterfaceQueue();
|
||||
@@ -1345,7 +1347,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
return false;
|
||||
}
|
||||
|
||||
LogPrintf("Using at most %i automatic connections (%i file descriptors available)\n", nMaxConnections, available_fds);
|
||||
LogInfo("Using at most %i automatic connections (%i file descriptors available)", nMaxConnections, available_fds);
|
||||
|
||||
// Warn about relative -datadir path.
|
||||
if (args.IsArgSet("-datadir") && !args.GetPathArg("-datadir").is_absolute()) {
|
||||
@@ -1402,7 +1404,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
} catch (const std::exception& e) {
|
||||
return InitError(Untranslated(strprintf("Unable to bind to IPC address '%s'. %s", address, e.what())));
|
||||
}
|
||||
LogPrintf("Listening for IPC requests on address %s\n", address);
|
||||
LogInfo("Listening for IPC requests on address %s", address);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1495,9 +1497,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
return false;
|
||||
}
|
||||
const uint256 asmap_version = (HashWriter{} << asmap).GetHash();
|
||||
LogPrintf("Using asmap version %s for IP bucketing\n", asmap_version.ToString());
|
||||
LogInfo("Using asmap version %s for IP bucketing", asmap_version.ToString());
|
||||
} else {
|
||||
LogPrintf("Using /16 prefix for IP bucketing\n");
|
||||
LogInfo("Using /16 prefix for IP bucketing");
|
||||
}
|
||||
|
||||
// Initialize netgroup manager
|
||||
@@ -1753,7 +1755,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
// As LoadBlockIndex can take several minutes, it's possible the user
|
||||
// requested to kill the GUI during the last operation. If so, exit.
|
||||
if (ShutdownRequested(node)) {
|
||||
LogPrintf("Shutdown requested. Exiting.\n");
|
||||
LogInfo("Shutdown requested. Exiting.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1808,10 +1810,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
} else {
|
||||
// Prior to setting NODE_NETWORK, check if we can provide historical blocks.
|
||||
if (!WITH_LOCK(chainman.GetMutex(), return chainman.BackgroundSyncInProgress())) {
|
||||
LogPrintf("Setting NODE_NETWORK on non-prune mode\n");
|
||||
LogInfo("Setting NODE_NETWORK on non-prune mode");
|
||||
g_local_services = ServiceFlags(g_local_services | NODE_NETWORK);
|
||||
} else {
|
||||
LogPrintf("Running node in NODE_NETWORK_LIMITED mode until snapshot background sync completes\n");
|
||||
LogInfo("Running node in NODE_NETWORK_LIMITED mode until snapshot background sync completes");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1870,7 +1872,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
// Import blocks and ActivateBestChain()
|
||||
ImportBlocks(chainman, vImportFiles);
|
||||
if (args.GetBoolArg("-stopafterblockimport", DEFAULT_STOPAFTERBLOCKIMPORT)) {
|
||||
LogPrintf("Stopping after block import\n");
|
||||
LogInfo("Stopping after block import");
|
||||
if (!(Assert(node.shutdown_request))()) {
|
||||
LogError("Failed to send shutdown signal after finishing block import\n");
|
||||
}
|
||||
@@ -1918,7 +1920,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
{
|
||||
LOCK(chainman.GetMutex());
|
||||
const auto& tip{*Assert(chainman.ActiveTip())};
|
||||
LogPrintf("block tree size = %u\n", chainman.BlockIndex().size());
|
||||
LogInfo("block tree size = %u", chainman.BlockIndex().size());
|
||||
chain_active_height = tip.nHeight;
|
||||
best_block_time = tip.GetBlockTime();
|
||||
if (tip_info) {
|
||||
@@ -1931,7 +1933,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
tip_info->header_time = chainman.m_best_header->GetBlockTime();
|
||||
}
|
||||
}
|
||||
LogPrintf("nBestHeight = %d\n", chain_active_height);
|
||||
LogInfo("nBestHeight = %d", chain_active_height);
|
||||
if (node.peerman) node.peerman->SetBestBlock(chain_active_height, std::chrono::seconds{best_block_time});
|
||||
|
||||
// Map ports with NAT-PMP
|
||||
@@ -2061,11 +2063,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
connOptions.m_specified_outgoing = connect;
|
||||
}
|
||||
if (!connOptions.m_specified_outgoing.empty() && !connOptions.vSeedNodes.empty()) {
|
||||
LogPrintf("-seednode is ignored when -connect is used\n");
|
||||
LogInfo("-seednode is ignored when -connect is used");
|
||||
}
|
||||
|
||||
if (args.IsArgSet("-dnsseed") && args.GetBoolArg("-dnsseed", DEFAULT_DNSSEED) && args.IsArgSet("-proxy")) {
|
||||
LogPrintf("-dnsseed is ignored when -connect is used and -proxy is specified\n");
|
||||
LogInfo("-dnsseed is ignored when -connect is used and -proxy is specified");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user