From 275341ee0f21a9bf641f5dcd62c4f069f468c560 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Mon, 5 Jun 2023 10:11:15 +0530 Subject: [PATCH] [ESP32] Config Option to enable/disable log filtering APIs (#27012) * [ESP32] Option to enable/disable log filtering APIs Also, - Removed the stale TODO * Fix the kconfig help to match with default value --- config/esp32/components/chip/Kconfig | 12 ++++++++---- src/platform/ESP32/CHIPPlatformConfig.h | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 1611bc081e25c1..f36c49f6fd080f 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -112,11 +112,15 @@ menu "CHIP Core" int "Set threshold in ms" default 700 help - Time threshold for warning that dispatched took too long. You can - set this default set to 0 to to disable event dispatching time - measurement and suppress the logs "Long dispatch time:...". + Time threshold for warning that dispatched took too long. You can + set this default set to 0 to to disable event dispatching time + measurement and suppress the logs "Long dispatch time:...". - # TODO: add log level selection + config CHIP_LOG_FILTERING + bool "CHIP log level filtering APIs" + default n + help + Option to enable/disable CHIP log level filtering APIs. endmenu # "General Options" diff --git a/src/platform/ESP32/CHIPPlatformConfig.h b/src/platform/ESP32/CHIPPlatformConfig.h index 9f7faedb8a0ff7..a01ead49544a20 100644 --- a/src/platform/ESP32/CHIPPlatformConfig.h +++ b/src/platform/ESP32/CHIPPlatformConfig.h @@ -41,7 +41,11 @@ // The ESP NVS implementation limits key names to 15 characters. #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 15 +#ifndef CONFIG_CHIP_LOG_FILTERING #define CHIP_LOG_FILTERING 0 +#else +#define CHIP_LOG_FILTERING CONFIG_CHIP_LOG_FILTERING +#endif #define CHIP_CONFIG_ABORT() abort()