lv_log.h
API reference for lv_log.h
Summary
Functions
public/logging/lv_log.h:63function
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 |
public/logging/lv_log.h:71function
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 |
... |
public/logging/lv_log.h:82function
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
public/logging/lv_log.h:32typedef
lv_log_level_t
typedef int8_t lv_log_level_tUsed by 1 function
lv_log_add— paramlevel
public/logging/lv_log.h:51typedef
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
LV_LOG_FILE
#define LV_LOG_FILE __FILE__LV_LOG_LINE
#define LV_LOG_LINE __LINE__LV_LOG_TRACE
#define LV_LOG_TRACE(...) \
do {}while(0)LV_LOG_INFO
#define LV_LOG_INFO(...) \
do {}while(0)LV_LOG_WARN
#define LV_LOG_WARN(...) \
lv_log_add(LV_LOG_LEVEL_WARN, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__)LV_LOG_WARN_ONCE
#define LV_LOG_WARN_ONCE(...) \
do { \
static int warned = 0; \
if(!warned) { \
warned = 1; \
lv_log_add(LV_LOG_LEVEL_WARN, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__); \
} \
} while(0)LV_LOG_DEPRECATED
#define LV_LOG_DEPRECATED(msg) \
LV_LOG_WARN_ONCE("Deprecated: " msg)LV_LOG_ERROR
#define LV_LOG_ERROR(...) \
lv_log_add(LV_LOG_LEVEL_ERROR, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__)LV_LOG_USER
#define LV_LOG_USER(...) \
lv_log_add(LV_LOG_LEVEL_USER, LV_LOG_FILE, LV_LOG_LINE, __func__, __VA_ARGS__)LV_LOG
#define LV_LOG(...) \
lv_log(__VA_ARGS__)Dependencies
Last updated on