mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-15 00:59:38 +02: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:
@@ -113,7 +113,7 @@ std::optional<common::SettingsValue> InterpretValue(const KeyInfo& key, const st
|
||||
}
|
||||
// Double negatives like -nofoo=0 are supported (but discouraged)
|
||||
if (value && !InterpretBool(*value)) {
|
||||
LogPrintf("Warning: parsed potentially confusing double-negative -%s=%s\n", key.name, *value);
|
||||
LogWarning("Parsed potentially confusing double-negative -%s=%s", key.name, *value);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -398,7 +398,7 @@ static void SaveErrors(const std::vector<std::string> errors, std::vector<std::s
|
||||
if (error_out) {
|
||||
error_out->emplace_back(error);
|
||||
} else {
|
||||
LogPrintf("%s\n", error);
|
||||
LogWarning("%s", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,7 +420,7 @@ bool ArgsManager::ReadSettingsFile(std::vector<std::string>* errors)
|
||||
for (const auto& setting : m_settings.rw_settings) {
|
||||
KeyInfo key = InterpretKey(setting.first); // Split setting key into section and argname
|
||||
if (!GetArgFlags('-' + key.name)) {
|
||||
LogPrintf("Ignoring unknown rw_settings value %s\n", setting.first);
|
||||
LogWarning("Ignoring unknown rw_settings value %s", setting.first);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -84,7 +84,7 @@ bool IsConfSupported(KeyInfo& key, std::string& error) {
|
||||
if (key.name == "reindex") {
|
||||
// reindex can be set in a config file but it is strongly discouraged as this will cause the node to reindex on
|
||||
// every restart. Allow the config but throw a warning
|
||||
LogPrintf("Warning: reindex=1 is set in the configuration file, which will significantly slow down startup. Consider removing or commenting out this option for better performance, unless there is currently a condition which makes rebuilding the indexes necessary\n");
|
||||
LogWarning("reindex=1 is set in the configuration file, which will significantly slow down startup. Consider removing or commenting out this option for better performance, unless there is currently a condition which makes rebuilding the indexes necessary");
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
@@ -109,7 +109,7 @@ bool ArgsManager::ReadConfigStream(std::istream& stream, const std::string& file
|
||||
m_settings.ro_config[key.section][key.name].push_back(*value);
|
||||
} else {
|
||||
if (ignore_invalid_keys) {
|
||||
LogPrintf("Ignoring unknown configuration value %s\n", option.first);
|
||||
LogWarning("Ignoring unknown configuration value %s", option.first);
|
||||
} else {
|
||||
error = strprintf("Invalid configuration value %s", option.first);
|
||||
return false;
|
||||
|
||||
@@ -58,8 +58,9 @@ void runCommand(const std::string& strCommand)
|
||||
#else
|
||||
int nErr = ::_wsystem(std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t>().from_bytes(strCommand).c_str());
|
||||
#endif
|
||||
if (nErr)
|
||||
LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr);
|
||||
if (nErr) {
|
||||
LogWarning("runCommand error: system(%s) returned %d", strCommand, nErr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user