Weirdness with logging.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Weirdness with logging.

Postby fly135 » Tue May 01, 2018 5:04 pm

This is my sdkconfig for logging....

Code: Select all

#
# Log output
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=
CONFIG_LOG_DEFAULT_LEVEL_ERROR=
CONFIG_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
CONFIG_LOG_DEFAULT_LEVEL=2
CONFIG_LOG_COLORS=y
But I'm seeing this after boot in my log....

Code: Select all

I (233) wifi: wifi firmware version: ebd3e5d
I (233) wifi: config NVS flash: enabled
I (233) wifi: config nano formating: disabled
I (263) wifi: Init dynamic tx buffer num: 32
I (263) wifi: Init data frame dynamic rx buffer num: 32
I (263) wifi: Init management frame dynamic rx buffer num: 32
I (263) wifi: Init static tx buffer num: 16
I (263) wifi: wifi driver task: 3ffd59ac, prio:23, stack:4096
I (273) wifi: Init static rx buffer num: 10
I (273) wifi: Init dynamic rx buffer num: 32
I (283) wifi: wifi power manager task: 0x3ffd5b20 prio: 21 stack: 2560
There is also code in my app that is printing with "ESP_LOGD" and they are coming out on the terminal as well.

If I put the following in my code then those prints are suppressed.

esp_log_level_set("*", ESP_LOG_NONE);

The logical explanation is that someone else's code is calling esp_log_level_set with different parameters, but I haven't nailed that down yet. Just wondering if logging works as expected for everyone else. I get used to seeing those log messages and it's only that I'm trying to eliminate then that I noticed this issue.

John A

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Weirdness with logging.

Postby fly135 » Tue May 01, 2018 5:10 pm

Here's more info. If I put "esp_log_level_set("*", ESP_LOG_NONE)" as the very first instruction in app_main it works. That means nothing after it can be changing the logging level. It's like something in the SDK is upping the log level before app_main is called.

John A

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Weirdness with logging.

Postby kolban » Tue May 01, 2018 5:50 pm

Is it possible that after changing your log level in sdkconfig that you didn't recompile the source files that are emitting those messages?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Weirdness with logging.

Postby fly135 » Tue May 01, 2018 5:56 pm

Oh I get it. The defines are in the app source and unless I do a make clean they don't get updated. But the statement I put in app_main overrides those defines. Totally makes sense. Thanks Kolban!

John A

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Weirdness with logging.

Postby fly135 » Tue May 01, 2018 6:17 pm

That wasn't the answer. I did a make clean and i'm still getting ESP_LOGD logs from code in my app, plus ESP_LOGI from the wifi that isn't in my app. sdkconfig is...

Code: Select all

#
# Log output
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=
CONFIG_LOG_DEFAULT_LEVEL_ERROR=
CONFIG_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
CONFIG_LOG_DEFAULT_LEVEL=2
CONFIG_LOG_COLORS=y

papaluna
Posts: 50
Joined: Tue Jan 30, 2018 11:27 am

Re: Weirdness with logging.

Postby papaluna » Tue May 01, 2018 10:31 pm

The ESP-IDF Wifi component used to set its own log level. I don't know if that is still the case in the current master branch.

I still do this in my projects:
````
// Production: dump less messages
esp_log_level_set("wifi", ESP_LOG_WARN);
esp_log_level_set("tcpip_adapter", ESP_LOG_WARN);
````
--
Paul.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Weirdness with logging.

Postby fly135 » Tue May 01, 2018 10:47 pm

I'm kind of thinking it might have something to do with my version of the SDK. I'm waiting for the next official release before changing.

John A

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Weirdness with logging.

Postby ESP_Angus » Wed May 02, 2018 4:58 am

Hi fly135,

Paul is correct. Because the wifi libraries are precompiled they don't follow the same compile-time configuration as the logging levels set everywhere else.

If you add the first line he mentions to your app_main() ( esp_log_level_set("wifi", ESP_LOG_WARN); ), then you can set the log level for WiFi.

I see there isn't a note about this in the documentation. Will fix.


Angus

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Weirdness with logging.

Postby ESP_Angus » Thu May 03, 2018 2:22 am

Instead of documenting the problem we've fixed the inconsistency so that the sdkconfig log level is applied correctly to the WiFi libraries. This fix will be on the master branch shortly, for ESP-IDF v3.1.

Who is online

Users browsing this forum: No registered users and 128 guests