It seems that
build_flags = -DCORE_DEBUG_LEVEL=x
in file platformio.ini does NOT affect “C” source files, only “CPP” ones.
In my IDE (see details at the end) it seems that ony “E” level are shown in “C” files. If you use LOGV it won’t be seen evend configuring DCORE_DEBUG_LEVEL=5
In CPP files all is fine.
I was using “esp_log.h” and the macros ESP_LOGx ESP_LOGE(TAG, "LOGE test"); ESP_LOGW(TAG, "LOGW test"); ESP_LOGI(TAG, "LOGI test"); ESP_LOGD(TAG, "LOGD test"); ESP_LOGV(TAG, "LOGV test");
And indepently of platformio.ini, only ESP_LOGE was be seen on the monitor port: E (170) Touch pad: LOGE test
BUT, if I maintain the previous macros and add yours… log_e("log_e test"); log_w("log_w test"); log_i("log_i test"); log_d("log_d test"); log_v("log_v test");
I can see all the logs (ESP_LOGx and log_x): [E][touchpad.c:80] initializeTouchPad(): LOGE test [W][touchpad.c:81] initializeTouchPad(): LOGW test [I][touchpad.c:82] initializeTouchPad(): LOGI test [E][touchpad.c:87] initializeTouchPad(): log_e test [W][touchpad.c:88] initializeTouchPad(): log_w test [I][touchpad.c:89] initializeTouchPad(): log_i test
As you can see the ESP_LOGx syntax is lost (TAG not shown).
Anyway, thanks for your help, I will use log_x and the #include <esp32-hal-log.h>
instead of #include “esp_log.h”
That file does get included by esp32-hal-log.h though
And those same macros are available, and should behave the same. esp_log.h seems to be the low-level component that does the actual logging, but esp32-hal-log.h is one layer above and compile-time deactivates those macros or functions.