mirror of
https://github.com/espressif/openthread.git
synced 2026-08-18 16:39:52 +00:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user