diff --git a/src/misc/lv_log.c b/src/misc/lv_log.c index 83c80058e..7e8661482 100644 --- a/src/misc/lv_log.c +++ b/src/misc/lv_log.c @@ -67,6 +67,8 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * { if(level >= _LV_LOG_LEVEL_NUM) return; /*Invalid level*/ + static uint32_t last_log_time = 0; + if(level >= LV_LOG_LEVEL) { va_list args; va_start(args, format); @@ -86,8 +88,8 @@ void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * char buf[512]; uint32_t t = lv_tick_get(); static const char * lvl_prefix[] = {"Trace", "Info", "Warn", "Error", "User"}; - lv_snprintf(buf, sizeof(buf), "[%s]\t(%d.%03d)\t %s: %s \t(in %s line #%d)\n", lvl_prefix[level], t / 1000, t % 1000, func, msg, &file[p], line); - + lv_snprintf(buf, sizeof(buf), "[%s]\t(%d.%03d, +%d)\t %s: %s \t(in %s line #%d)\n", lvl_prefix[level], t / 1000, t % 1000, t - last_log_time, func, msg, &file[p], line); + last_log_time = t; lv_log(buf); } }