[mac] log some of the less useful RX errors at debug log level (#3302)

This commit is contained in:
Abtin Keshavarzian
2018-11-14 17:32:26 -08:00
committed by Jonathan Hui
parent 49523f72e6
commit c7d8ae3693
+18 -3
View File
@@ -2201,14 +2201,29 @@ const char *Mac::OperationToString(Operation aOperation)
void Mac::LogFrameRxFailure(const Frame *aFrame, otError aError) const
{
otLogLevel logLevel;
switch (aError)
{
case OT_ERROR_ABORT:
case OT_ERROR_NO_FRAME_RECEIVED:
case OT_ERROR_DESTINATION_ADDRESS_FILTERED:
logLevel = OT_LOG_LEVEL_DEBG;
break;
default:
logLevel = OT_LOG_LEVEL_INFO;
break;
}
if (aFrame == NULL)
{
otLogInfoMac("Frame rx failed, error:%s", otThreadErrorToString(aError));
otLogMac(logLevel, "Frame rx failed, error:%s", otThreadErrorToString(aError));
}
else
{
otLogInfoMac("Frame rx failed, error:%s, %s", otThreadErrorToString(aError),
aFrame->ToInfoString().AsCString());
otLogMac(logLevel, "Frame rx failed, error:%s, %s", otThreadErrorToString(aError),
aFrame->ToInfoString().AsCString());
}
}