[dua/mlr-manager] refine logs (#6590)

This commit is contained in:
Rongli Sun
2021-05-07 19:27:11 -07:00
committed by GitHub
parent 122d8b8d71
commit e99d16e81c
2 changed files with 12 additions and 8 deletions
+4 -2
View File
@@ -528,14 +528,16 @@ void DuaManager::PerformNextRegistration(void)
Get<DataPollSender>().SendFastPolls();
}
otLogInfoDua("Sent DUA.req for DUA %s", dua.ToString().AsCString());
exit:
if (error == kErrorNoBufs)
{
UpdateCheckDelay(Mle::kNoBufDelay);
}
otLogInfoDua("PerformNextRegistration: %s", ErrorToString(error));
FreeMessageOnError(message, error);
otLogInfoDua("Sent DUA.req for DUA %s: %s", dua.ToString().AsCString(), ErrorToString(error));
}
void DuaManager::HandleDuaResponse(Coap::Message *aMessage, const Ip6::MessageInfo *aMessageInfo, Error aResult)
@@ -565,7 +567,7 @@ exit:
mRegistrationTask.Post();
}
otLogInfoDua("Received DUA.req: %s", ErrorToString(error));
otLogInfoDua("Received DUA.rsp: %s", ErrorToString(error));
}
void DuaManager::HandleDuaNotification(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
+8 -6
View File
@@ -330,7 +330,7 @@ Error MlrManager::RegisterMulticastListeners(const otIp6Address *
#else
if (!Get<MeshCoP::Commissioner>().IsActive())
{
otLogWarnMlr("MLR.req sent without active commissioner session.");
otLogWarnMlr("MLR.req without active commissioner session for test.");
}
#endif
@@ -446,8 +446,10 @@ Error MlrManager::SendMulticastListenerRegistrationMessage(const otIp6Address *
error = Get<Tmf::Agent>().SendMessage(*message, messageInfo, aResponseHandler, aResponseContext);
otLogInfoMlr("Sent MLR.req: addressNum=%d", aAddressNum);
exit:
otLogInfoMlr("Send MLR.req: %s, addressNum=%d", ErrorToString(error), aAddressNum);
otLogInfoMlr("SendMulticastListenerRegistrationMessage(): %s", ErrorToString(error));
FreeMessageOnError(message, error);
return error;
}
@@ -756,19 +758,19 @@ void MlrManager::LogMlrResponse(Error aResult,
OT_UNUSED_VARIABLE(aFailedAddresses);
OT_UNUSED_VARIABLE(aFailedAddressNum);
#if OPENTHREAD_CONFIG_LOG_BBR
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_WARN) && (OPENTHREAD_CONFIG_LOG_MLR == 1)
if (aResult == kErrorNone && aError == kErrorNone && aStatus == ThreadStatusTlv::MlrStatus::kMlrSuccess)
{
otLogInfoBbr("Receive MLR.rsp OK", ErrorToString(aResult));
otLogInfoMlr("Receive MLR.rsp OK");
}
else
{
otLogWarnBbr("Receive MLR.rsp: result=%s, error=%s, status=%d, failedAddressNum=%d", ErrorToString(aResult),
otLogWarnMlr("Receive MLR.rsp: result=%s, error=%s, status=%d, failedAddressNum=%d", ErrorToString(aResult),
ErrorToString(aError), aStatus, aFailedAddressNum);
for (uint8_t i = 0; i < aFailedAddressNum; i++)
{
otLogWarnBbr("MLR failed: %s", aFailedAddresses[i].ToString().AsCString());
otLogWarnMlr("MA failed: %s", aFailedAddresses[i].ToString().AsCString());
}
}
#endif