ESP32 application log output in the same format as the core log output

I love the ESP32 core level log output. It is easy to configure and gives me the file name and line number where the log output was created:

But when I want to use the same log functions for log output from my application, I have the problem that all output is mixed up and it is difficult to see the logs from my application between all the lines of the core log output:

What I want is

So I looked how the core level log output works and created a similar output that gives me the option to mix application log output of any level I want with core log output of any level I want. E.g. I want only ERROR level logs from the core, but I want to have DEBUG level logs from my application.

The file I created duplicates the core log defines as my application log defines. Inside my application code I use myLog_x() functions instead of the log_x() functions to create log output.

Example:

And all is done with a simple header file.

Source code and more explanation is in my >>> Github repo <<<.

Here is the simple header file I created:

 

Hope it helps someone to get better log output from his application

Loading...
Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Leave a Reply

Your email address will not be published. Required fields are marked *

Free Link Directory