Skip to content

Commit

Permalink
[ESP32] Add an option to set default log level for CHIP logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinmayLonkar authored and Chinmay Lonkar committed Sep 6, 2024
1 parent 9b58d4c commit 7434e92
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 12 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7434e92

Please sign in to comment.