From 7434e92989a41cf1a1a1e128633946ed0ceb683b Mon Sep 17 00:00:00 2001 From: ChinmayLonkar Date: Fri, 6 Sep 2024 10:51:24 +0530 Subject: [PATCH] [ESP32] Add an option to set default log level for CHIP logs --- config/esp32/components/chip/CMakeLists.txt | 8 ++++---- config/esp32/components/chip/Kconfig | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 7e9894a8d66065..85141d5f962241 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -87,25 +87,25 @@ if (CONFIG_CHIP_CONFIG_IM_PRETTY_PRINT) endif() # Config the chip log level by IDF menuconfig -if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 1) +if (CONFIG_CHIP_LOG_DEFAULT_LEVEL GREATER_EQUAL 1) chip_gn_arg_bool ("chip_error_logging" "true") else() chip_gn_arg_bool ("chip_error_logging" "false") endif() -if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 3) +if (CONFIG_CHIP_LOG_DEFAULT_LEVEL GREATER_EQUAL 3) chip_gn_arg_bool ("chip_progress_logging" "true") else() chip_gn_arg_bool ("chip_progress_logging" "false") endif() -if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 4) +if (CONFIG_CHIP_LOG_DEFAULT_LEVEL GREATER_EQUAL 4) chip_gn_arg_bool ("chip_detail_logging" "true") else() chip_gn_arg_bool ("chip_detail_logging" "false") endif() -if (CONFIG_LOG_DEFAULT_LEVEL GREATER_EQUAL 5) +if (CONFIG_CHIP_LOG_DEFAULT_LEVEL GREATER_EQUAL 5) chip_gn_arg_bool ("chip_automation_logging" "true") else() chip_gn_arg_bool ("chip_automation_logging" "false") diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 40beb7d5ce4643..ce9e6cc28690fa 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -1172,6 +1172,18 @@ menu "CHIP Device Layer" To see detailed logging please set default log level to Debug. (Component config --> Log output --> Default log verbosity --> Debug) + config CHIP_LOG_DEFAULT_LEVEL + int + range 0 LOG_DEFAULT_LEVEL + default LOG_DEFAULT_LEVEL + help + Default log level for CHIP logs. Log levels are as follows: + 0: None - CHIP logging disabled + 1: Error - Errors only + 3: Detail - Errors and progress logs + 4: Info - Errors, progress, and detail logs + 5: Trace - All logs enabled (most verbose) + endmenu config CHIP_ENABLE_BDX_LOG_TRANSFER