Page 1 of 1

LOG_LOCAL_LEVEL doesn’t always work

Posted: Thu Oct 07, 2021 12:10 pm
by samsam
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

Re: LOG_LOCAL_LEVEL doesn’t always work

Posted: Thu Oct 07, 2021 11:37 pm
by mbratch
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.

Re: LOG_LOCAL_LEVEL doesn’t always work

Posted: Fri Oct 08, 2021 2:34 am
by samsam
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