lv_log.h
API reference for lv_log.h
Summary
Functions
misc/lv_log.h:72function
lv_log_register_print_cb
Register custom print/write function to call when a log is added. It can format its "File path", "Line number" and "Description" as required and send the formatted log message to a console or serial port.
void lv_log_register_print_cb(lv_log_print_g_cb_t print_cb)| Name | Type | Description |
|---|---|---|
print_cb | lv_log_print_g_cb_t | a function pointer to print a log |
misc/lv_log.h:80function
lv_log
Print a log message via printf if enabled with LV_LOG_PRINTF in lv_conf.h and/or a print callback if registered with lv_log_register_print_cb
void lv_log(const char *format,...)| Name | Type | Description |
|---|---|---|
format | const char * | printf-like format string |
... |
misc/lv_log.h:91function
lv_log_add
Add a log
void lv_log_add(lv_log_level_t level, const char *file, int line, const char *func, const char *format,...)| Name | Type | Description |
|---|---|---|
level | lv_log_level_t | the level of log. (From lv_log_level_t enum) |
file | const char * | name of the file when the log added |
line | int | line number in the source code where the log added |
func | const char * | name of the function when the log added |
format | const char * | printf-like format string |
... |
Typedefs
misc/lv_log.h:41typedef
lv_log_level_t
typedef int8_t lv_log_level_tUsed by 1 function
lv_log_add— paramlevel
misc/lv_log.h:60typedef
lv_log_print_g_cb_t
typedef void(* lv_log_print_g_cb_t) (lv_log_level_t level, const char *buf)Log print function. Receives a string buffer to print".
Used by 1 function
lv_log_register_print_cb— paramprint_cb
Macros
misc/lv_log.h:26macro
LV_LOG_LEVEL_TRACE
#define LV_LOG_LEVEL_TRACE 0Log detailed information.
misc/lv_log.h:27macro
LV_LOG_LEVEL_INFO
#define LV_LOG_LEVEL_INFO 1Log important events.
misc/lv_log.h:28macro
LV_LOG_LEVEL_WARN
#define LV_LOG_LEVEL_WARN 2Log if something unwanted happened but didn't caused problem.
misc/lv_log.h:29macro
LV_LOG_LEVEL_ERROR
#define LV_LOG_LEVEL_ERROR 3Log only critical issues, when system may fail.
misc/lv_log.h:30macro
LV_LOG_LEVEL_USER
#define LV_LOG_LEVEL_USER 4Log only custom log messages added by the user.
misc/lv_log.h:31macro
LV_LOG_LEVEL_NONE
#define LV_LOG_LEVEL_NONE 5Do not log anything.
misc/lv_log.h:32macro
LV_LOG_LEVEL_NUM
#define LV_LOG_LEVEL_NUM 5Number of log levels
misc/lv_log.h:46macro
LV_LOG_FILE
#define LV_LOG_FILE __FILE__misc/lv_log.h:47macro
LV_LOG_LINE
#define LV_LOG_LINE __LINE__misc/lv_log.h:101macro
LV_LOG_TRACE
#define LV_LOG_TRACE(...) \
do {}while(0)misc/lv_log.h:109macro
LV_LOG_INFO
#define LV_LOG_INFO(...) \
do {}while(0)misc/lv_log.h:115macro
LV_LOG_WARN
#define LV_LOG_WARN(...) \
lv_log_add(LV_LOG_LEVEL_WARN, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__)misc/lv_log.h:123macro
LV_LOG_ERROR
#define LV_LOG_ERROR(...) \
lv_log_add(LV_LOG_LEVEL_ERROR, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__)misc/lv_log.h:131macro
LV_LOG_USER
#define LV_LOG_USER(...) \
lv_log_add(LV_LOG_LEVEL_USER, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__)misc/lv_log.h:139macro
LV_LOG
#define LV_LOG(...) \
lv_log(__VA_ARGS__)Dependencies
How is this guide?
Last updated on