summary refs log tree commit diff
path: root/logging.h
diff options
context:
space:
mode:
authorrubin <rubinowyblask@meow.li>2026-05-22 16:26:30 +0200
committerrubin <rubinowyblask@meow.li>2026-05-22 16:26:30 +0200
commit8323c2b2d6e7cbcc6ccc7f4c2eb4b3ff37c8c8c5 (patch)
treec3cc21585967b12860a70da9bf4be7d4dd6f3455 /logging.h
parent89abeab564abac85e0cd33e8e6333193cb9cbe9f (diff)
prepend time with aura_printf
Signed-off-by: rubin <rubinowyblask@meow.li>
Diffstat (limited to 'logging.h')
-rw-r--r--logging.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/logging.h b/logging.h
index 6ad5729..0e676dd 100644
--- a/logging.h
+++ b/logging.h
@@ -1,12 +1,20 @@
 #include <stdarg.h>
 #include <unistd.h>
+#include <time.h>
 
 static void
 aura_printf(const char *fmt, ...)
 {
+	char timestr[20] = { 0 };
 	va_list args = { 0 };
+	struct tm *m = { 0 };
+	time_t stamp = 0;
 
-	printf("[%d] ", getpid());
+	stamp = time(NULL);
+	m = localtime(&stamp);
+	strftime((char *)&timestr, 20, "%G-%m-%d %H:%M:%S", m);
+
+	printf("{%s} [%d] ", (char *)&timestr, getpid());
 	va_start(args, fmt);
 	vprintf(fmt, args);
 	va_end(args);