summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-05-29 21:44:25 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-05-29 21:44:25 +0100
commit0bfc35c88e75a7eb47c38f7a31b6cf7f84130ea5 (patch)
tree4140260f710d0c9b54fe1913409c7f23df11a6ef
parent94afbd330fc6c35f12326216ee21c5e87830eb8d (diff)
Read debug setting from configuration file immediately before doing debug file rotation to avoid writing to previous debug file.
-rw-r--r--TODO4
-rw-r--r--blabouncer.c14
2 files changed, 10 insertions, 8 deletions
diff --git a/TODO b/TODO
index e416113..65f042a 100644
--- a/TODO
+++ b/TODO
@@ -13,4 +13,6 @@ Implement daemon (background) mode.
Implement BLABOUNCER EXIT command.
-Some text gets written to previous debug.txt upon startup (getconfstr() output).
+Implement connect commands (plus maybe a specific NickServ IDENTIFY command).
+
+Include NOTICEs in the replay log.
diff --git a/blabouncer.c b/blabouncer.c
index 851df7a..e0c9b21 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -2558,13 +2558,6 @@ int main(int argc, char *argv[]) {
}
}
- // Is debugging enabled?
- debug = getconfint("debug", settings.conffile);
- if (!snprintf(debugpath, PATH_MAX, "%s/debug.txt", settings.basedir)) {
- fprintf(stderr, "Error while preparing debug path location!\n");
- exit(1);
- }
-
// Make sure the base directory exists
struct stat st = {0};
if (stat(settings.basedir, &st) == -1) {
@@ -2582,6 +2575,13 @@ int main(int argc, char *argv[]) {
// Is replay logging enabled?
settings.replaylogging = getconfint("replaylogging", settings.conffile);
+ // Is debugging enabled?
+ debug = getconfint("debug", settings.conffile);
+ if (!snprintf(debugpath, PATH_MAX, "%s/debug.txt", settings.basedir)) {
+ fprintf(stderr, "Error while preparing debug path location!\n");
+ exit(1);
+ }
+
// Prepare the debug file
// (Keep DEBUGFILESKEEP number of debug files around for past debugging)
if (DEBUGFILESKEEP > 0) {