From 107346782e6dcae11fc0d4d605fe7bfed532b37f Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk <66371704+kkasperczyk-no@users.noreply.github.com> Date: Tue, 4 Jan 2022 16:31:13 +0100 Subject: [PATCH] [zephyr] Added Kconfig options to control Matter logs level (#13288) Zephyr logging platform currently uses hardcoded DEBUG log level and it's not possible to change it through KConfig options. Added MATTER logging module to Zephyr subsys and enabled setting Matter logs level using CONFIG_MATTER_LOG_LEVEL option. --- config/nrfconnect/app/sample-defaults.conf | 1 + config/zephyr/Kconfig | 4 ++++ src/platform/Zephyr/Logging.cpp | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/nrfconnect/app/sample-defaults.conf b/config/nrfconnect/app/sample-defaults.conf index 93ac000214ad8b..7e451f40ed6536 100644 --- a/config/nrfconnect/app/sample-defaults.conf +++ b/config/nrfconnect/app/sample-defaults.conf @@ -20,6 +20,7 @@ CONFIG_STD_CPP14=y CONFIG_LOG=y CONFIG_LOG_MODE_MINIMAL=y +CONFIG_MATTER_LOG_LEVEL_DBG=y CONFIG_PRINTK_SYNC=y CONFIG_ASSERT=y CONFIG_HW_STACK_PROTECTION=y diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index b3404c5ef3de08..a390f78b429527 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -125,4 +125,8 @@ config APP_LINK_WITH_CHIP Add Connected Home over IP header files to the 'app' include path and link the 'app' with Connected Home over IP libraries. +module = MATTER +module-str = Matter +source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" + endif diff --git a/src/platform/Zephyr/Logging.cpp b/src/platform/Zephyr/Logging.cpp index f2bb80877e4d5a..017ed0f478313c 100644 --- a/src/platform/Zephyr/Logging.cpp +++ b/src/platform/Zephyr/Logging.cpp @@ -18,7 +18,7 @@ #define LOG_MESSAGE(msg) (msg) #endif -LOG_MODULE_REGISTER(chip, LOG_LEVEL_DBG); +LOG_MODULE_REGISTER(chip, CONFIG_MATTER_LOG_LEVEL); namespace chip { namespace DeviceLayer {