kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 77848e07088c30fac9f2a836e321d5ed0ab426cf
parent 4b4767ac39c336be84bb9e5f74067d2bf32cbcfb
Author: Joris Vink <joris@coders.se>
Date:   Sun, 12 Sep 2021 15:19:37 +0200

Always use logfile when set, even if !foreground.

Diffstat:
src/log.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/log.c b/src/log.c @@ -92,7 +92,7 @@ kore_log(int prio, const char *fmt, ...) } else { str = kore_buf_stringify(&buf, NULL); - if (kore_foreground) + if (kore_foreground || fp != stdout) log_print(prio, "[parent]: %s\n", str); else syslog(prio, "[parent]: %s", str); @@ -117,7 +117,7 @@ log_from_worker(struct kore_msg *msg, const void *data) wlog = data; name = kore_worker_name(wlog->wid); - if (kore_foreground) { + if (kore_foreground || fp != stdout) { log_print(wlog->prio, "%s: %.*s\n", name, (int)wlog->loglen, wlog->logmsg); } else {