summaryrefslogtreecommitdiff
path: root/snac.c
diff options
context:
space:
mode:
Diffstat (limited to 'snac.c')
-rw-r--r--snac.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/snac.c b/snac.c
index 41e1984..7fbb61e 100644
--- a/snac.c
+++ b/snac.c
@@ -95,8 +95,9 @@ void srv_debug(int level, xs_str *str)
xs *tm = xs_str_localtime(0, "%H:%M:%S");
fprintf(stderr, "%s %s\n", tm, str);
- /* if the ~/error/ folder exists, also write to a file there */
- xs *lf = xs_fmt("%s/error/debug.log", srv_basedir);
+ /* if the ~/log/ folder exists, also write to a file there */
+ xs *dt = xs_str_localtime(0, "%Y-%m-%d");
+ xs *lf = xs_fmt("%s/log/%s.log", srv_basedir, dt);
FILE *f;
if ((f = fopen(lf, "a")) != NULL) {
fprintf(f, "%s %s\n", tm, str);