diff options
Diffstat (limited to 'src/log.c')
| -rw-r--r-- | src/log.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -1,7 +1,6 @@ #include "log.h" #include "util.h" -#include <err.h> #include <stdbool.h> #include <stdlib.h> @@ -19,7 +18,7 @@ log_init(void) if (!envstr) return; log_file = fopen(envstr, "w+"); - if (!log_file) err(1, "fopen %s", envstr); + if (!log_file) ERROR(SYSTEM, "fopen %s", envstr); log_active = true; } @@ -47,3 +46,13 @@ log_info(const char *fmtstr, ...) fflush(log_file); } +void +log_infov(const char *fmtstr, va_list ap) +{ + if (!log_active) return; + + vfprintf(log_file, fmtstr, ap); + + fflush(log_file); +} + |
