diff --git a/src/core/openthread-core-default-config.h b/src/core/openthread-core-default-config.h index 5a38f4b9a..43b3e3c6d 100644 --- a/src/core/openthread-core-default-config.h +++ b/src/core/openthread-core-default-config.h @@ -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 * diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp index ce6a07287..85ec64880 100644 --- a/src/core/thread/mesh_forwarder.cpp +++ b/src/core/thread/mesh_forwarder.cpp @@ -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];