diff options
| author | default <nobody@localhost> | 2023-06-15 06:15:39 +0200 |
|---|---|---|
| committer | default <nobody@localhost> | 2023-06-15 06:15:39 +0200 |
| commit | 14b2f697689fbdfa946b310d65ef3079ee7fec5b (patch) | |
| tree | d3670c1b429039d2716c879ada71a0e4f094ffac /snac.c | |
| parent | 9a4ff572053b4e82f4e7d061fabe40c28b383eef (diff) | |
If a ~/log/ folder exists, also write the log there.
Diffstat (limited to 'snac.c')
| -rw-r--r-- | snac.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |