From cc2ed783c5ccb1b84f6f99d46661fb4ac0f177e3 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 11 Jul 2015 23:22:37 +0200 Subject: [PATCH] output: improve notice and warning/error color handling --- src/util-debug.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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;