summary refs log tree commit diff
diff options
context:
space:
mode:
-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);