diff options
Diffstat (limited to 'ui/daemon/ui.c')
| -rw-r--r-- | ui/daemon/ui.c | 26 |
1 files changed, 24 insertions, 2 deletions
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); |
