[logging] introduce LogWarnOnError() for standardized error logging (#9996)

This commit adds `LogWarnOnError()` to emit warning-level logs on
errors. The emitted log includes the error code. This replaces custom
`LogError()` across modules, simplifying the code.
This commit is contained in:
Abtin Keshavarzian
2024-04-05 09:07:19 -07:00
committed by GitHub
parent 65bc830edb
commit 223935bf0c
27 changed files with 95 additions and 158 deletions
+2 -2
View File
@@ -158,7 +158,7 @@ Error DuaManager::GenerateDomainUnicastAddressIid(void)
}
else
{
LogWarn("Generate DUA: %s", ErrorToString(error));
LogWarnOnError(error, "generate DUA");
}
return error;
@@ -548,7 +548,7 @@ exit:
UpdateCheckDelay(kNoBufDelay);
}
LogInfo("PerformNextRegistration: %s", ErrorToString(error));
LogWarnOnError(error, "perform next registration");
FreeMessageOnError(message, error);
}