aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-07-03 20:28:34 -0400
committerDeterminant <[email protected]>2018-07-03 20:28:34 -0400
commit9e89c3b330a8d7cc4fb256411b755c126ba37ec3 (patch)
tree5808c13078322e35bd7a3992122dad91c1125680 /include
parent2b956e784e740853a19ed8856f296a166a270e62 (diff)
...
Diffstat (limited to 'include')
-rw-r--r--include/salticidae/util.h10
1 files changed, 7 insertions, 3 deletions
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");
}