lv_log.h

Defines

LV_LOG_LEVEL_TRACE

Log detailed information.

LV_LOG_LEVEL_INFO

Log important events.

LV_LOG_LEVEL_WARN

Log if something unwanted happened but didn't caused problem.

LV_LOG_LEVEL_ERROR

Log only critical issues, when system may fail.

LV_LOG_LEVEL_USER

Log only custom log messages added by the user.

LV_LOG_LEVEL_NONE

Do not log anything.

LV_LOG_LEVEL_NUM

Number of log levels

LV_LOG_FILE
LV_LOG_LINE
LV_LOG_TRACE(...)
LV_LOG_INFO(...)
LV_LOG_WARN(...)
LV_LOG_ERROR(...)
LV_LOG_USER(...)
LV_LOG(...)

Typedefs

typedef int8_t lv_log_level_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".

Functions

void lv_log_register_print_cb(lv_log_print_g_cb_t 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.

参数:

print_cb -- a function pointer to print a log

void lv_log(const char *format, ...)

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

参数:
  • format -- printf-like format string

  • ... -- parameters for format

void lv_log_add(lv_log_level_t level, const char *file, int line, const char *func, const char *format, ...)

Add a log

参数:
  • level -- the level of log. (From lv_log_level_t enum)

  • file -- name of the file when the log added

  • line -- line number in the source code where the log added

  • func -- name of the function when the log added

  • format -- printf-like format string

  • ... -- parameters for format