mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
log: Use LogWarning for non-critical logs
As per doc/developer-notes#logging, LogWarning should be used for severe problems that do not warrant shutting down the node
This commit is contained in:
14
src/init.cpp
14
src/init.cpp
@@ -198,7 +198,7 @@ static void RemovePidFile(const ArgsManager& args)
|
||||
const auto pid_path{GetPidFile(args)};
|
||||
if (std::error_code error; !fs::remove(pid_path, error)) {
|
||||
std::string msg{error ? error.message() : "File does not exist"};
|
||||
LogPrintf("Unable to remove PID file (%s): %s\n", fs::PathToString(pid_path), msg);
|
||||
LogWarning("Unable to remove PID file (%s): %s", fs::PathToString(pid_path), msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1342,7 +1342,7 @@ static ChainstateLoadResult InitAndLoadChainstate(
|
||||
index->Interrupt();
|
||||
index->Stop();
|
||||
if (!(index->Init() && index->StartBackgroundSync())) {
|
||||
LogPrintf("[snapshot] WARNING failed to restart index %s on snapshot chain\n", index->GetName());
|
||||
LogWarning("[snapshot] Failed to restart index %s on snapshot chain", index->GetName());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1406,11 +1406,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
|
||||
// Warn about relative -datadir path.
|
||||
if (args.IsArgSet("-datadir") && !args.GetPathArg("-datadir").is_absolute()) {
|
||||
LogPrintf("Warning: relative datadir option '%s' specified, which will be interpreted relative to the "
|
||||
"current working directory '%s'. This is fragile, because if bitcoin is started in the future "
|
||||
"from a different location, it will be unable to locate the current data files. There could "
|
||||
"also be data loss if bitcoin is started while in a temporary directory.\n",
|
||||
args.GetArg("-datadir", ""), fs::PathToString(fs::current_path()));
|
||||
LogWarning("Relative datadir option '%s' specified, which will be interpreted relative to the "
|
||||
"current working directory '%s'. This is fragile, because if bitcoin is started in the future "
|
||||
"from a different location, it will be unable to locate the current data files. There could "
|
||||
"also be data loss if bitcoin is started while in a temporary directory.",
|
||||
args.GetArg("-datadir", ""), fs::PathToString(fs::current_path()));
|
||||
}
|
||||
|
||||
assert(!node.scheduler);
|
||||
|
||||
Reference in New Issue
Block a user