log: Use LogError for fatal errors

This commit is contained in:
MarcoFalke
2025-11-27 10:31:30 +01:00
parent 22229de728
commit fa0018d011
10 changed files with 46 additions and 46 deletions

View File

@@ -47,8 +47,8 @@ static void HandleError(const leveldb::Status& status)
if (status.ok())
return;
const std::string errmsg = "Fatal LevelDB error: " + status.ToString();
LogPrintf("%s\n", errmsg);
LogPrintf("You can use -debug=leveldb to get more complete diagnostic messages\n");
LogError("%s", errmsg);
LogInfo("You can use -debug=leveldb to get more complete diagnostic messages");
throw dbwrapper_error(errmsg);
}
@@ -309,7 +309,7 @@ std::optional<std::string> CDBWrapper::ReadImpl(std::span<const std::byte> key)
if (!status.ok()) {
if (status.IsNotFound())
return std::nullopt;
LogPrintf("LevelDB read failure: %s\n", status.ToString());
LogError("LevelDB read failure: %s", status.ToString());
HandleError(status);
}
return strValue;
@@ -324,7 +324,7 @@ bool CDBWrapper::ExistsImpl(std::span<const std::byte> key) const
if (!status.ok()) {
if (status.IsNotFound())
return false;
LogPrintf("LevelDB read failure: %s\n", status.ToString());
LogError("LevelDB read failure: %s", status.ToString());
HandleError(status);
}
return true;