From 88b2fa6fbb2e44d29154e5b1e976bf2261a6b079 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 11 Dec 2019 14:38:29 -0800 Subject: [PATCH] [logging] remove otLogWarnMleErr (#4398) --- src/core/common/logging.hpp | 4 ---- src/core/thread/mle.cpp | 12 ++++++------ src/core/thread/mle_router.cpp | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/core/common/logging.hpp b/src/core/common/logging.hpp index 32c45feb1..5efdbbb57 100644 --- a/src/core/common/logging.hpp +++ b/src/core/common/logging.hpp @@ -385,16 +385,12 @@ extern "C" { #if OPENTHREAD_CONFIG_LOG_MLE == 1 #define otLogCritMle(aFormat, ...) otLogCrit(OT_LOG_REGION_MLE, _OT_REGION_MLE_PREFIX aFormat, ##__VA_ARGS__) #define otLogWarnMle(aFormat, ...) otLogWarn(OT_LOG_REGION_MLE, _OT_REGION_MLE_PREFIX aFormat, ##__VA_ARGS__) -#define otLogWarnMleErr(aError, aFormat, ...) \ - otLogWarn(OT_LOG_REGION_MLE, _OT_REGION_MLE_PREFIX "Error %s: " aFormat, otThreadErrorToString(aError), \ - ##__VA_ARGS__) #define otLogNoteMle(aFormat, ...) otLogNote(OT_LOG_REGION_MLE, _OT_REGION_MLE_PREFIX aFormat, ##__VA_ARGS__) #define otLogInfoMle(aFormat, ...) otLogInfo(OT_LOG_REGION_MLE, _OT_REGION_MLE_PREFIX aFormat, ##__VA_ARGS__) #define otLogDebgMle(aFormat, ...) otLogDebg(OT_LOG_REGION_MLE, _OT_REGION_MLE_PREFIX aFormat, ##__VA_ARGS__) #else #define otLogCritMle(aFormat, ...) #define otLogWarnMle(aFormat, ...) -#define otLogWarnMleErr(aError, aFormat, ...) #define otLogNoteMle(aFormat, ...) #define otLogInfoMle(aFormat, ...) #define otLogDebgMle(aFormat, ...) diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 5fad430c6..108983cba 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -2896,7 +2896,7 @@ otError Mle::HandleDataResponse(const Message & aMessage, if (error != OT_ERROR_NONE) { - otLogWarnMleErr(error, "Failed to process Data Response"); + otLogWarnMle("Failed to process Data Response: %s", otThreadErrorToString(error)); } if (mDataRequestState == kDataRequestNone && !IsRxOnWhenIdle()) @@ -3325,7 +3325,7 @@ exit: if (error != OT_ERROR_NONE) { - otLogWarnMleErr(error, "Failed to process Parent Response"); + otLogWarnMle("Failed to process Parent Response: %s", otThreadErrorToString(error)); } return error; @@ -3450,7 +3450,7 @@ exit: if (error != OT_ERROR_NONE) { - otLogWarnMleErr(error, "Failed to process Child ID Response"); + otLogWarnMle("Failed to process Child ID Response: %s", otThreadErrorToString(error)); } return error; @@ -3660,7 +3660,7 @@ exit: } else { - otLogWarnMleErr(error, "Failed to process Child Update Response"); + otLogWarnMle("Failed to process Child Update Response: %s", otThreadErrorToString(error)); } return error; @@ -3854,7 +3854,7 @@ exit: if (error != OT_ERROR_NONE) { - otLogWarnMleErr(error, "Failed to process Discovery Response"); + otLogWarnMle("Failed to process Discovery Response: %s", otThreadErrorToString(error)); } return error; @@ -4009,7 +4009,7 @@ exit: if (error != OT_ERROR_NONE) { - otLogWarnMle("Failed to inform previous parent, error:%s", otThreadErrorToString(error)); + otLogWarnMle("Failed to inform previous parent: %s", otThreadErrorToString(error)); if (message != NULL) { diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 9e1fe80f5..20b7bf769 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -2706,7 +2706,7 @@ exit: if (error != OT_ERROR_NONE) { - otLogWarnMleErr(error, "Failed to process Discovery Request"); + otLogWarnMle("Failed to process Discovery Request: %s", otThreadErrorToString(error)); } return error;