/**1* @file lv_log.h2*3*/45#ifndef LV_LOG_H6#define LV_LOG_H78#ifdef __cplusplus9extern "C" {10#endif1112/*********************13* INCLUDES14*********************/15#ifdef LV_CONF_INCLUDE_SIMPLE16#include "lv_conf.h"17#else18#include "../../lv_conf.h"19#endif20#include <stdint.h>2122/*********************23* DEFINES24*********************/2526/*Possible log level. For compatibility declare it independently from `USE_LV_LOG`*/2728#define LV_LOG_LEVEL_TRACE 0 /*A lot of logs to give detailed information*/29#define LV_LOG_LEVEL_INFO 1 /*Log important events*/30#define LV_LOG_LEVEL_WARN 2 /*Log if something unwanted happened but didn't caused problem*/31#define LV_LOG_LEVEL_ERROR 3 /*Only critical issue, when the system may fail*/32#define _LV_LOG_LEVEL_NUM 43334typedef int8_t lv_log_level_t;3536#if USE_LV_LOG37/**********************38* TYPEDEFS39**********************/404142/**********************43* GLOBAL PROTOTYPES44**********************/4546/**47* Register custom print (or anything else) function to call when log is added48* @param f a function pointer:49* `void my_print (lv_log_level_t level, const char * file, uint32_t line, const char * dsc)`50*/51void lv_log_register_print(void f(lv_log_level_t, const char *, uint32_t, const char *));5253/**54* Add a log55* @param level the level of log. (From `lv_log_level_t` enum)56* @param file name of the file when the log added57* @param line line number in the source code where the log added58* @param dsc description of the log59*/60void lv_log_add(lv_log_level_t level, const char * file, int line, const char * dsc);6162/**********************63* MACROS64**********************/6566#define LV_LOG_TRACE(dsc) lv_log_add(LV_LOG_LEVEL_TRACE, __FILE__, __LINE__, dsc);67#define LV_LOG_INFO(dsc) lv_log_add(LV_LOG_LEVEL_INFO, __FILE__, __LINE__, dsc);68#define LV_LOG_WARN(dsc) lv_log_add(LV_LOG_LEVEL_WARN, __FILE__, __LINE__, dsc);69#define LV_LOG_ERROR(dsc) lv_log_add(LV_LOG_LEVEL_ERROR, __FILE__, __LINE__, dsc);7071#else /*USE_LV_LOG*/7273/*Do nothing if `USE_LV_LOG 0`*/74#define lv_log_add(level, file, line, dsc) {;}75#define LV_LOG_TRACE(dsc) {;}76#define LV_LOG_INFO(dsc) {;}77#define LV_LOG_WARN(dsc) {;}78#define LV_LOG_ERROR(dsc) {;}79#endif /*USE_LV_LOG*/8081#ifdef __cplusplus82} /* extern "C" */83#endif8485#endif /*LV_LOG_H*/868788