From 6572725a7ada11a33906af4e8243781bac556d43 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Thu, 24 Sep 2015 14:20:42 +0200 Subject: [PATCH] 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. --- src/util-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util-debug.c b/src/util-debug.c index f1ac0463e505..d9af08c4381a 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; }