From a360f2e46ecad3670b6843508f61e555b0af7b6a Mon Sep 17 00:00:00 2001 From: Marcin K Szczodrak Date: Wed, 4 Jan 2017 14:55:45 -0800 Subject: [PATCH] add OPENTHREAD_CONFIG_LOG_PKT_DUMP (#1109) --- src/core/common/logging.cpp | 4 ++++ src/core/openthread-core-default-config.h | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/core/common/logging.cpp b/src/core/common/logging.cpp index 7351d9c5f..06dd47a62 100644 --- a/src/core/common/logging.cpp +++ b/src/core/common/logging.cpp @@ -50,6 +50,7 @@ extern "C" { #endif +#if OPENTHREAD_CONFIG_LOG_PKT_DUMP == 1 /** * This static method outputs a line of the memory dump. * @@ -148,6 +149,9 @@ void otDump(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aId, const otLogDump("%s", buf); } +#else +void otDump(otLogLevel, otLogRegion, const char *, const void *, const size_t) {} +#endif #ifdef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL const char *otLogLevelToString(otLogLevel aLevel) diff --git a/src/core/openthread-core-default-config.h b/src/core/openthread-core-default-config.h index 672b3dfd8..b562da614 100644 --- a/src/core/openthread-core-default-config.h +++ b/src/core/openthread-core-default-config.h @@ -389,6 +389,16 @@ #define OPENTHREAD_CONFIG_LOG_MEM 1 #endif // OPENTHREAD_CONFIG_LOG_MEM +/** + * @def OPENTHREAD_CONFIG_LOG_PKT_DUMP + * + * Define to enable log content of packets. + * + */ +#ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +#endif // OPENTHREAD_CONFIG_LOG_PKT_DUMP + /** * @def OPENTHREAD_CONFIG_LOG_NETDIAG *