diff options
author | Phil Jones <philj56@gmail.com> | 2021-10-31 16:47:03 +0000 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2021-10-31 16:54:20 +0000 |
commit | 74adfe0cbca300e73774c6e0aa9b3c53a5e5b57b (patch) | |
tree | 88d0efbdd9755849eb22ee3478595df5c8e69a34 /src/log.c | |
parent | c691b8e48c572e2d5f1c7c16c8f42babd7d706d5 (diff) |
Add HiDPI support and lots of cleanup.
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); } |