Page 1 of 1

Improved logging to esp-idf

Posted: Sun Jul 29, 2018 5:31 pm
by JoaoLopesF

I made one header file (log.h) to use in esp-idf projects to improve the logging.

Are simple precompiler macros to ESP_LOGx and ESP_EARLY_LOGx,
thats extends the powerfull esp-idf logging with:
  • - Show the function name thats the log origins
    This is usefull to debug, without need
    put function names in each log

    - Show the core (C0 or C1)
    That indicates the core that is executing
    the function that contains the log call
    Usefull to optimize and balance Esp32 multi-core
Example of use:

How about this:

Code: Select all

void createTask2 () {

    // Create a task 2 @ core 1 (if have it)

    logD("creating task 2");

And log output of esp-idf monitor will show it:

Code: Select all

D (1650)P(02) demo_log: (createTask2)(C0) creating task 2
Please access the github to more information: