提交 6ddf8469 编写于 作者: A an-erd

Moved LV_USE_LOG and log level to Kconfig

上级 5da571fc
......@@ -578,4 +578,37 @@ menu "LVGL configuration"
default n
endmenu
menu "Log Settings"
config LVGL_USE_LOG
bool "Enable the log module"
default n
choice LVGL_LOG_LEVEL
bool "Default log verbosity" if LVGL_USE_LOG
default LVGL_LOG_LEVEL_INFO
help
Specify how important log should be added.
config LVGL_LOG_LEVEL_TRACE
bool "Trace - Detailed information"
config LVGL_LOG_LEVEL_INFO
bool "Info - Log important events"
config LVGL_LOG_LEVEL_WARN
bool "Warn - Log if something unwanted happened"
config LVGL_LOG_LEVEL_ERROR
bool "Error - Only critical issues"
config LVGL_LOG_LEVEL_NONE
bool "None - Do not log anything"
endchoice
config LVGL_LOG_PRINTF
bool "Print the log with 'printf'" if LVGL_USE_LOG
default y
help
Use printf for log output.
If not set the user needs to register a callback with `lv_log_register_print_cb`.
endmenu
endmenu
......@@ -308,7 +308,12 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
*===============*/
/*1: Enable the log module*/
#define LV_USE_LOG 0
#if defined CONFIG_LVGL_USE_LOG
# define LV_USE_LOG 1
#else
# define LV_USE_LOG 0
#endif
#if LV_USE_LOG
/* How important log should be added:
* LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
......@@ -317,11 +322,25 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i
* LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
* LV_LOG_LEVEL_NONE Do not log anything
*/
#if defined CONFIG_LVGL_LOG_LEVEL_TRACE
# define LV_LOG_LEVEL LV_LOG_LEVEL_TRACE
#elif defined CONFIG_LVGL_LOG_LEVEL_INFO
# define LV_LOG_LEVEL LV_LOG_LEVEL_INFO
#elif defined CONFIG_LVGL_LOG_LEVEL_WARN
# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
#elif defined CONFIG_LVGL_LOG_LEVEL_ERROR
# define LV_LOG_LEVEL LV_LOG_LEVEL_ERROR
#elif defined CONFIG_LVGL_LOG_LEVEL_NONE
# define LV_LOG_LEVEL LV_LOG_LEVEL_NONE
#endif
/* 1: Print the log with 'printf';
* 0: user need to register a callback with `lv_log_register_print_cb`*/
#if defined CONFIG_LVGL_LOG_PRINTF
# define LV_LOG_PRINTF 1
#else
# define LV_LOG_PRINTF 0
#endif
#endif /*LV_USE_LOG*/
/*=================
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册