From 9e89c3b330a8d7cc4fb256411b755c126ba37ec3 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 3 Jul 2018 20:28:34 -0400 Subject: ... --- include/salticidae/util.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/salticidae/util.h b/include/salticidae/util.h index 19d87cb..e5d653a 100644 --- a/include/salticidae/util.h +++ b/include/salticidae/util.h @@ -51,12 +51,16 @@ class Logger { protected: FILE *output; bool opened; + const char *prefix; void write(const char *tag, const char *fmt, va_list ap); public: - Logger() : output(stderr), opened(false) {} - Logger(FILE *f) : output(f) {} - Logger(const char *filename): opened(true) { + Logger(const char *prefix): + output(stderr), opened(false), prefix(prefix) {} + Logger(const char *prefix, FILE *f): + output(f), opened(false), prefix(prefix) {} + Logger(const char *prefix, const char *filename): + opened(true), prefix(prefix) { if ((output = fopen(filename, "w")) == nullptr) throw SalticidaeError("logger cannot open file"); } -- cgit v1.2.3-70-g09d2