From e99d16e81cce7d0fe3c77215e319a64db8a0a310 Mon Sep 17 00:00:00 2001 From: Rongli Sun Date: Sat, 8 May 2021 10:27:11 +0800 Subject: [PATCH] [dua/mlr-manager] refine logs (#6590) --- src/core/thread/dua_manager.cpp | 6 ++++-- src/core/thread/mlr_manager.cpp | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/thread/dua_manager.cpp b/src/core/thread/dua_manager.cpp index 8feeb9e5f..e67b83c3a 100644 --- a/src/core/thread/dua_manager.cpp +++ b/src/core/thread/dua_manager.cpp @@ -528,14 +528,16 @@ void DuaManager::PerformNextRegistration(void) Get().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) diff --git a/src/core/thread/mlr_manager.cpp b/src/core/thread/mlr_manager.cpp index 7944ed696..0261bbd20 100644 --- a/src/core/thread/mlr_manager.cpp +++ b/src/core/thread/mlr_manager.cpp @@ -330,7 +330,7 @@ Error MlrManager::RegisterMulticastListeners(const otIp6Address * #else if (!Get().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().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