From: Eric Leblond Date: Thu, 24 Sep 2015 12:20:42 +0000 (+0200) Subject: util-debug: don't colorize if a redirect is used X-Git-Tag: suricata-3.0RC1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6572725a7ada11a33906af4e8243781bac556d43;p=thirdparty%2Fsuricata.git util-debug: don't colorize if a redirect is used It is better to disable the color mode when a redirect of stderr is done to avoid getting colorized output in the generated file. --- diff --git a/src/util-debug.c b/src/util-debug.c index f1ac0463e5..d9af08c438 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -776,7 +776,7 @@ static inline SCLogOPIfaceCtx *SCLogInitConsoleOPIface(const char *log_format, } iface_ctx->log_level = tmp_log_level; - if (isatty(fileno(stdout))) { + if (isatty(fileno(stdout)) && isatty(fileno(stderr))) { iface_ctx->use_color = TRUE; }