LOG_LOCAL_LEVEL doesn’t always work

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

LOG_LOCAL_LEVEL doesn’t always work

Postby samsam » Thu Oct 07, 2021 12:10 pm

In ESP-IDF4.2.1 Logging library – Is there any other prerequisites to use LOG_LOCAL_LEVEL other than #define before including esp_log.h, because I have couple files where I use it, but on some files works, on other doesn’t work? :(

The only differences upfront I see on those my files are the #include directives before #define LOG_LOCAL_LEVEL

https://docs.espressif.com/projects/esp ... m/log.html


Thanks

User avatar
mbratch
Posts: 303
Joined: Fri Jun 11, 2021 1:51 pm

Re: LOG_LOCAL_LEVEL doesn’t always work

Postby mbratch » Thu Oct 07, 2021 11:37 pm

In the cases where it is not working, is it being set lower than the default level?

In one place in the documentation, it says:
To raise log level above the default one for a given file, define LOG_LOCAL_LEVEL to one of the ESP_LOG_* values, before including esp_log.h in this file.
Some parts of the documentation don't specify "above" so it is a little unclear. So I wonder if this is what's going on.

samsam
Posts: 50
Joined: Sun Jun 04, 2017 5:26 pm

Re: LOG_LOCAL_LEVEL doesn’t always work

Postby samsam » Fri Oct 08, 2021 2:34 am

All LOG_LOCAL_LEVEL defines (in working and not working files) are:
#define LOG_LOCAL_LEVEL ESP_LOG_DEBUG
which is 4

(I tried also on files that dont work // #define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE // which is 5)

While
CONFIG_LOG_DEFAULT_LEVEL=3

So all LOG_LOCAL_LEVEL set were higher than default level

Thanks

Who is online

Users browsing this forum: No registered users and 80 guests