From bda5ad2ec9fa333c8200451496d6c251abbeee19 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Sat, 21 Mar 2026 01:36:24 +0100 Subject: Adds data server (WIP) --- ui/daemon/ui.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'ui/daemon/ui.c') diff --git a/ui/daemon/ui.c b/ui/daemon/ui.c index 1f6c35c..28bade9 100644 --- a/ui/daemon/ui.c +++ b/ui/daemon/ui.c @@ -3,7 +3,18 @@ uint64_t g_step_block; void info_impl(const char *restrict fmt, ...) { assert(fmt); - printf("\033[1;34m[INFO]\033[0m "); + + time_t t = time(NULL); + struct tm tm = *localtime(&t); + printf( + "\r%d-%02d-%02d %02d:%02d:%02d -- \033[1;34mINFO\033[0m ", + tm.tm_year + 1900, + tm.tm_mon + 1, + tm.tm_mday, + tm.tm_hour, + tm.tm_min, + tm.tm_sec + ); va_list args; va_start(args, fmt); @@ -15,7 +26,18 @@ void info_impl(const char *restrict fmt, ...) { void warn_impl(const char *restrict fmt, ...) { assert(fmt); - printf("\033[1;33m[WARN]\033[0m "); + + time_t t = time(NULL); + struct tm tm = *localtime(&t); + printf( + "\r%d-%02d-%02d %02d:%02d:%02d -- \033[1;33mWARN\033[0m ", + tm.tm_year + 1900, + tm.tm_mon + 1, + tm.tm_mday, + tm.tm_hour, + tm.tm_min, + tm.tm_sec + ); va_list args; va_start(args, fmt); -- cgit v1.2.3-70-g09d2