]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: improve debug format by adding function name
authorVictor Julien <vjulien@oisf.net>
Fri, 6 Jan 2023 13:50:34 +0000 (14:50 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 17 Jan 2023 10:25:44 +0000 (11:25 +0100)
src/util-debug.c
src/util-debug.h

index 60f67bac45ea86c0efc015c5e8f904d82c2b5bd8..2cecc4d4c5fd567370f15145e311893493eee04f 100644 (file)
@@ -1085,13 +1085,13 @@ static inline const char *SCLogGetDefaultLogFormat(const SCLogLevel lvl)
     const char *prog_ver = GetProgramVersion();
     if (strstr(prog_ver, "RELEASE") != NULL) {
         if (lvl <= SC_LOG_NOTICE)
-            return SC_LOG_DEF_LOG_FORMAT_REL;
+            return SC_LOG_DEF_LOG_FORMAT_REL_NOTICE;
         else if (lvl <= SC_LOG_INFO)
-            return SC_LOG_DEF_LOG_FORMAT_RELV;
-        else if (lvl <= SC_LOG_PERF)
-            return SC_LOG_DEF_LOG_FORMAT_RELVV;
+            return SC_LOG_DEF_LOG_FORMAT_REL_INFO;
+        else if (lvl <= SC_LOG_CONFIG)
+            return SC_LOG_DEF_LOG_FORMAT_REL_CONFIG;
     }
-    return SC_LOG_DEF_LOG_FORMAT_DEV;
+    return SC_LOG_DEF_LOG_FORMAT_DEBUG;
 }
 
 /**
index 167f9c2fa0165f5d77400b47ff691d99b9e52f46..808cc8a5a00cc7c9565160f15ca32c7b49d8becb 100644 (file)
@@ -75,14 +75,10 @@ typedef enum {
 
 /* The default log_format, if it is not supplied by the user */
 #define SC_LOG_DEF_FILE_FORMAT      "[%i - %m] %z %d: %S: %M"
-#define SC_LOG_DEF_LOG_FORMAT_REL   "%D: %S: %M"
-#define SC_LOG_DEF_LOG_FORMAT_RELV  "%d: %S: %M"
-#define SC_LOG_DEF_LOG_FORMAT_RELVV "[%i] %d: %S: %M"
-#ifdef DEBUG
-#define SC_LOG_DEF_LOG_FORMAT_DEV "%d: %S: %M [%f:%l]"
-#else
-#define SC_LOG_DEF_LOG_FORMAT_DEV "%d: %S: %M [%f:%l]"
-#endif
+#define SC_LOG_DEF_LOG_FORMAT_REL_NOTICE "%D: %S: %M"
+#define SC_LOG_DEF_LOG_FORMAT_REL_INFO   "%d: %S: %M"
+#define SC_LOG_DEF_LOG_FORMAT_REL_CONFIG "[%i] %d: %S: %M"
+#define SC_LOG_DEF_LOG_FORMAT_DEBUG      "(%n) %d: %S: %M [%f:%l]"
 
 /* The maximum length of the log message */
 #define SC_LOG_MAX_LOG_MSG_LEN 2048