[mesh-forwarder] config option if to log src/dst IPv6 addresses (#2594)

This commit adds a new config option which determines if the source
and destination IPv6 addresses of received/sent messages are logged
from `MeshForwarder::LogIp6Message()`.
This commit is contained in:
Abtin Keshavarzian
2018-02-28 19:50:07 +00:00
committed by Jonathan Hui
parent 79c4830c3c
commit b9e9b6bd63
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -763,6 +763,17 @@
#define OPENTHREAD_CONFIG_LOG_SUFFIX ""
#endif
/**
* @def OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES
*
* If defined as 1 when IPv6 message info is logged in mesh-forwarder, the source and destination IPv6 addresses of
* messages are also included.
*
*/
#ifndef OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES
#define OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES 1
#endif
/**
* @def OPENTHREAD_CONFIG_PLAT_LOG_FUNCTION
*
+1 -1
View File
@@ -1443,7 +1443,7 @@ void MeshForwarder::LogIp6Message(MessageAction aAction,
const char * actionText;
const char * priorityText;
bool shouldLogRss = false;
bool shouldLogSrcDstAddresses = true;
bool shouldLogSrcDstAddresses = (OPENTHREAD_CONFIG_LOG_SRC_DST_IP_ADDRESSES != 0);
char stringBuffer[Ip6::Address::kIp6AddressStringSize];
char rssString[RssAverager::kStringSize];