]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: improve notice and warning/error color handling
authorVictor Julien <victor@inliniac.net>
Sat, 11 Jul 2015 21:22:37 +0000 (23:22 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 2 Jun 2016 11:14:54 +0000 (13:14 +0200)
src/util-debug.c

index a55a559906b833d02b55511ad7d15420f318cbbf..d8e607a2f46c42cf953484953a5b725a9e5459a4 100644 (file)
@@ -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;