From: Victor Julien Date: Sat, 11 Jul 2015 21:22:37 +0000 (+0200) Subject: output: improve notice and warning/error color handling X-Git-Tag: suricata-3.1RC1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc2ed783c5ccb1b84f6f99d46661fb4ac0f177e3;p=thirdparty%2Fsuricata.git output: improve notice and warning/error color handling --- diff --git a/src/util-debug.c b/src/util-debug.c index a55a559906..d8e607a2f4 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -475,8 +475,12 @@ static SCError SCLogMessageGetBuffer( } } - char *xyellow = error_code > SC_OK ? yellow : ""; - cw = snprintf(temp, SC_LOG_MAX_LOG_MSG_LEN - (temp - buffer), "%s%s%s", xyellow, message, reset); + char *hi = ""; + if (error_code > SC_OK) + hi = red; + else if (log_level <= SC_LOG_NOTICE) + hi = yellow; + cw = snprintf(temp, SC_LOG_MAX_LOG_MSG_LEN - (temp - buffer), "%s%s%s", hi, message, reset); if (cw < 0) goto error; temp += cw;