[logging] add OPENTHREAD_CONFIG_LOG_MESHCOP (#5124)

This commit adds `OPENTHREAD_CONFIG_LOG_MESHCOP` which enable
MeshCoP modules logging. This replaces the use of MLE log config
`OPENTHREAD_CONFIG_LOG_MLE` for controlling MeshCop logging.

The makefiles are also updated to include the new config when
"FULL_LOGS" option is used.
This commit is contained in:
Abtin Keshavarzian
2020-06-19 09:49:38 -07:00
committed by GitHub
parent 8367f885ea
commit c4fd7df086
5 changed files with 15 additions and 3 deletions
+1
View File
@@ -242,6 +242,7 @@ if(OT_FULL_LOGS)
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_IP6=1")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MAC=1")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MEM=1")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MESHCOP=1")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_MLE=1")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_NETDATA=1")
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LOG_NETDIAG=1")
+1
View File
@@ -290,6 +290,7 @@ LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_ICMP=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_IP6=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MAC=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MEM=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MESHCOP=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_MLE=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_NETDATA=1
LOG_FLAGS += -DOPENTHREAD_CONFIG_LOG_NETDIAG=1
+1 -1
View File
@@ -288,7 +288,7 @@ extern "C" {
* @param[in] ... Arguments for the format specification.
*
*/
#if OPENTHREAD_CONFIG_LOG_MLE == 1
#if OPENTHREAD_CONFIG_LOG_MESHCOP == 1
#define otLogCritMeshCoP(...) otLogCrit(OT_LOG_REGION_MESH_COP, _OT_REGION_MESH_COP_PREFIX __VA_ARGS__)
#define otLogWarnMeshCoP(...) otLogWarn(OT_LOG_REGION_MESH_COP, _OT_REGION_MESH_COP_PREFIX __VA_ARGS__)
#define otLogNoteMeshCoP(...) otLogNote(OT_LOG_REGION_MESH_COP, _OT_REGION_MESH_COP_PREFIX __VA_ARGS__)
+10
View File
@@ -126,6 +126,16 @@
#define OPENTHREAD_CONFIG_LOG_MLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_LOG_MESHCOP
*
* Define to enable MeshCoP logging.
*
*/
#ifndef OPENTHREAD_CONFIG_LOG_MESHCOP
#define OPENTHREAD_CONFIG_LOG_MESHCOP 1
#endif
/**
* @def OPENTHREAD_CONFIG_LOG_ARP
*
+2 -2
View File
@@ -1147,7 +1147,7 @@ exit:
// LCOV_EXCL_START
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MLE == 1)
#if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MESHCOP == 1)
const char *Commissioner::StateToString(otCommissionerState aState)
{
@@ -1183,7 +1183,7 @@ void Commissioner::LogJoinerEntry(const char *, const Joiner &) const
{
}
#endif // (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MLE == 1)
#endif // (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MESHCOP == 1)
// LCOV_EXCL_STOP