mirror of
https://github.com/luc-github/ESP3D.git
synced 2026-03-21 23:26:52 +01:00
* Remove all output flags * Masse replace name function / class to sync with ESP3D-TFT * Create ESP3DMessageManager class to handle messages creation / deletion (import functions of ESp3DClient from ESp3D-TFT) * Move to new messaging API of ESP3D-TFT * Remove empty line from remote screen dispatching * Replace \n to space and \r to nothing in remote screen dispatching * Add missing default entry for sensor device * Fix buzzer for ESP32 missing ledc initialization with latest core * Move formatBytes to esp3d_string * Add welcome message to telnet connection\ * Add display to the new messaging API * Add sticky authentication on Serial / SerialBridge /Telnet/Data web socket and BT * Log simplification * Use enum class instead of typdef enum for ESP3DAuthenticationLevel to be sure correct enum is used * (v3) Home Assistant notification support (#971) * Add notification via post request * Extend t1 size to 255 bytes * Hide Home Assistant notifications from web UI (#974) * Sync with ESP3DLib on serial_socket * Add some sanity check to avoid unnecessary message copies * Update ESP0.cpp --------- Co-authored-by: David Buezas <dbuezas@users.noreply.github.com>
1.3 KiB
1.3 KiB
.. include:: /header.rst
:github_url: |github_link_base|/porting/log.md
Logging
LVGL has a built-in Log module to inform the user about what is happening in the library.
Log level
To enable logging, set LV_USE_LOG 1 in lv_conf.h and set LV_LOG_LEVEL to one of the following values:
LV_LOG_LEVEL_TRACEA lot of logs to give detailed informationLV_LOG_LEVEL_INFOLog important eventsLV_LOG_LEVEL_WARNLog if something unwanted happened but didn't cause a problemLV_LOG_LEVEL_ERROROnly critical issues, where the system may failLV_LOG_userOnly user messagesLV_LOG_LEVEL_NONEDo not log anything
The events which have a higher level than the set log level will be logged too. E.g. if you LV_LOG_LEVEL_WARN, errors will be also logged.
Printing logs
Logging with printf
If your system supports printf, you just need to enable LV_LOG_PRINTF in lv_conf.h to send the logs with printf.
Custom log function
If you can't use printf or want to use a custom function to log, you can register a "logger" callback with lv_log_register_print_cb().
For example:
void my_log_cb(const char * buf)
{
serial_send(buf, strlen(buf));
}
...
lv_log_register_print_cb(my_log_cb);
Add logs
You can also use the log module via the LV_LOG_TRACE/INFO/WARN/ERROR/USER(text) functions.