summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-06-01 19:11:00 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-06-01 19:11:00 +0100
commitc3f421e4046faf8b5f39cd1ad36bc4869405fcc9 (patch)
tree5d2c8575076a82b6ebe518c91fb14a339e92fe7c /config.c
parent0c153207be8a31fc66b7f6e9d0b849357017e34a (diff)
Put debug logs in subdirectory and have max number to keep be configurable. Also fix possible crash in debugprint() if debug directory doesn't exist yet.
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/config.c b/config.c
index bd1aeb8..41f07d6 100644
--- a/config.c
+++ b/config.c
@@ -233,7 +233,10 @@ int createconfigfile(char *filename) {
"\n"
"# Debug verbosity (\"0\" for critical only, \"1\" for some extra info, \"2\" for full debug mode)\n"
"# (All output goes to <basedir>/debug.txt)\n"
- "debug = \"2\"\n";
+ "debug = \"2\"\n"
+ "\n"
+ "# Number of debug logs to keep\n"
+ "debugkeep = \"5\"\n";
// Write complete string to file
if ((fprintf(fp, "%s", string)) < 0) {