summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2021-10-31 16:47:03 +0000
committerPhil Jones <philj56@gmail.com>2021-10-31 16:54:20 +0000
commit74adfe0cbca300e73774c6e0aa9b3c53a5e5b57b (patch)
tree88d0efbdd9755849eb22ee3478595df5c8e69a34 /src/log.c
parentc691b8e48c572e2d5f1c7c16c8f42babd7d706d5 (diff)
Add HiDPI support and lots of cleanup.
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/log.c b/src/log.c
index eb4d165..a27bc6c 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <time.h>
void log_error(const char *const fmt, ...)
{
@@ -23,9 +24,11 @@ void log_debug(const char *const fmt, ...)
#ifndef DEBUG
return;
#endif
+ struct timespec t;
+ clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
va_list args;
va_start(args, fmt);
- printf("[DEBUG]: ");
+ fprintf(stderr, "[%ld.%03ld][DEBUG]: ", t.tv_sec, t.tv_nsec / 1000000);
vprintf(fmt, args);
va_end(args);
}