summaryrefslogtreecommitdiffstats
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 6b318b5..81a1c0b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -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);
+}
+