summaryrefslogtreecommitdiff
path: root/snac.c
diff options
context:
space:
mode:
Diffstat (limited to 'snac.c')
-rw-r--r--snac.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/snac.c b/snac.c
index 691c2e2..41e1984 100644
--- a/snac.c
+++ b/snac.c
@@ -94,6 +94,14 @@ void srv_debug(int level, xs_str *str)
94 if (dbglevel >= level) { 94 if (dbglevel >= level) {
95 xs *tm = xs_str_localtime(0, "%H:%M:%S"); 95 xs *tm = xs_str_localtime(0, "%H:%M:%S");
96 fprintf(stderr, "%s %s\n", tm, str); 96 fprintf(stderr, "%s %s\n", tm, str);
97
98 /* if the ~/error/ folder exists, also write to a file there */
99 xs *lf = xs_fmt("%s/error/debug.log", srv_basedir);
100 FILE *f;
101 if ((f = fopen(lf, "a")) != NULL) {
102 fprintf(f, "%s %s\n", tm, str);
103 fclose(f);
104 }
97 } 105 }
98 106
99 xs_free(str); 107 xs_free(str);