From: Victor Julien Date: Fri, 6 Jan 2023 13:50:34 +0000 (+0100) Subject: output: improve debug format by adding function name X-Git-Tag: suricata-7.0.0-rc1~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee6c39b985b82c8d27274ec5ba0d676ba8e63ed5;p=thirdparty%2Fsuricata.git output: improve debug format by adding function name --- diff --git a/src/util-debug.c b/src/util-debug.c index 60f67bac45..2cecc4d4c5 100644 --- a/src/util-debug.c +++ b/src/util-debug.c @@ -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; } /** diff --git a/src/util-debug.h b/src/util-debug.h index 167f9c2fa0..808cc8a5a0 100644 --- a/src/util-debug.h +++ b/src/util-debug.h @@ -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