diff --git a/lib/log.c b/lib/log.c index fab1a89bf..50e414c04 100644 --- a/lib/log.c +++ b/lib/log.c @@ -304,12 +304,14 @@ void log_vprint(struct log *l, const char *lvl, const char *fmt, va_list ap) /* Timestamp & Severity */ strcatf(&buf, "%10.3f %-5s ", time_delta(&l->epoch, &ts), lvl); - /* Indention */ + /* Indention in case we log to the terminal */ #ifdef __GNUC__ - for (int i = 0; i < indent; i++) - strcatf(&buf, "%s ", BOX_UD); + if (l->file == stderr || l->file == stdout) { + for (int i = 0; i < indent; i++) + strcatf(&buf, "%s ", BOX_UD); - strcatf(&buf, "%s ", BOX_UDR); + strcatf(&buf, "%s ", BOX_UDR); + } #endif /* Format String */