From 6cd700952af8677d97f6f28da7c94a921ad27b67 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 11 Dec 2024 17:01:44 +0800 Subject: [PATCH] fix(wifi): Fixed the max log level not work when it exceeds the default log level --- .../getting_started/station/main/station_example_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/wifi/getting_started/station/main/station_example_main.c b/examples/wifi/getting_started/station/main/station_example_main.c index d68ef39a21..3ed7465daa 100644 --- a/examples/wifi/getting_started/station/main/station_example_main.c +++ b/examples/wifi/getting_started/station/main/station_example_main.c @@ -168,6 +168,12 @@ void app_main(void) } ESP_ERROR_CHECK(ret); + if (CONFIG_LOG_MAXIMUM_LEVEL > CONFIG_LOG_DEFAULT_LEVEL) { + /* If you only want to open more logs in the wifi module, you need to make the max level greater than the default level, + * and call esp_log_level_set() before esp_wifi_init() to improve the log level of the wifi module. */ + esp_log_level_set("wifi", CONFIG_LOG_MAXIMUM_LEVEL); + } + ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); wifi_init_sta(); }