]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: remove unused log levels
authorVictor Julien <vjulien@oisf.net>
Thu, 1 Dec 2022 12:02:45 +0000 (13:02 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 20 Dec 2022 07:51:33 +0000 (08:51 +0100)
Critical, alert and emergency were unused, so remove.

src/util-debug.c
src/util-debug.h

index ab788160acd63e252dac8ad29b6c3fb0f689597f..507bcbb0dcbb5d19e6dd9e5095d1755de967412a 100644 (file)
 
 // clang-format off
 /* holds the string-enum mapping for the enums held in the table SCLogLevel */
-SCEnumCharMap sc_log_level_map[ ] = {
-    { "Not set",        SC_LOG_NOTSET},
+SCEnumCharMap sc_log_level_map[] = {
+    { "Not set",        SC_LOG_NOTSET },
     { "None",           SC_LOG_NONE },
-    { "Emergency",      SC_LOG_EMERGENCY },
-    { "Alert",          SC_LOG_ALERT },
-    { "Critical",       SC_LOG_CRITICAL },
     { "Error",          SC_LOG_ERROR },
     { "Warning",        SC_LOG_WARNING },
     { "Notice",         SC_LOG_NOTICE },
@@ -57,9 +54,6 @@ SCEnumCharMap sc_log_level_map[ ] = {
 SCEnumCharMap sc_log_slevel_map[] = {
     { "Not set",        SC_LOG_NOTSET },
     { "None",           SC_LOG_NONE },
-    { "E",              SC_LOG_EMERGENCY },
-    { "A",              SC_LOG_ALERT },
-    { "C",              SC_LOG_CRITICAL },
     { "E",              SC_LOG_ERROR },
     { "W",              SC_LOG_WARNING },
     { "i",              SC_LOG_NOTICE },
@@ -129,15 +123,6 @@ static inline int SCLogMapLogLevelToSyslogLevel(int log_level)
     int syslog_log_level = 0;
 
     switch (log_level) {
-        case SC_LOG_EMERGENCY:
-            syslog_log_level = LOG_EMERG;
-            break;
-        case SC_LOG_ALERT:
-            syslog_log_level = LOG_ALERT;
-            break;
-        case SC_LOG_CRITICAL:
-            syslog_log_level = LOG_CRIT;
-            break;
         case SC_LOG_ERROR:
             syslog_log_level = LOG_ERR;
             break;
@@ -1677,8 +1662,7 @@ static int SCLogTestInit02(void)
     sc_lid->startup_message = "Test02";
     sc_lid->global_log_level = SC_LOG_DEBUG;
     sc_lid->op_filter = "boo";
-    sc_iface_ctx = SCLogInitOPIfaceCtx("file", "%m - %d", SC_LOG_ALERT,
-                                       logfile);
+    sc_iface_ctx = SCLogInitOPIfaceCtx("file", "%m - %d", SC_LOG_WARNING, logfile);
     SCLogAppendOPIfaceCtx(sc_iface_ctx, sc_lid);
     sc_iface_ctx = SCLogInitOPIfaceCtx("console", NULL, SC_LOG_ERROR,
                                        NULL);
index c6219fc2b65e1b320966a73b5e6d0c628ad302c1..3d42a1ba099a3fb12c095d45e9dd79de2daf390c 100644 (file)
@@ -48,9 +48,6 @@
 typedef enum {
     SC_LOG_NOTSET = -1,
     SC_LOG_NONE = 0,
-    SC_LOG_EMERGENCY,
-    SC_LOG_ALERT,
-    SC_LOG_CRITICAL,
     SC_LOG_ERROR,
     SC_LOG_WARNING,
     SC_LOG_NOTICE,
@@ -265,34 +262,6 @@ void SCLogErr(int x, const char *file, const char *func, const int line, const c
 #define SCLogErrorRaw(file, func, line, ...)                                                       \
     SCLogErr(SC_LOG_ERROR, (file), (func), (line), _sc_module, __VA_ARGS__)
 
-/**
- * \brief Macro used to log CRITICAL messages.
- *
- * \retval err_code Error code that has to be logged along with the
- *                  critical message
- * \retval ...      Takes as argument(s), a printf style format message
- */
-#define SCLogCritical(...)                                                                         \
-    SCLogErr(SC_LOG_CRITICAL, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__)
-/**
- * \brief Macro used to log ALERT messages.
- *
- * \retval err_code Error code that has to be logged along with the
- *                  alert message
- * \retval ...      Takes as argument(s), a printf style format message
- */
-#define SCLogAlert(...)                                                                            \
-    SCLogErr(SC_LOG_ALERT, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__)
-/**
- * \brief Macro used to log EMERGENCY messages.
- *
- * \retval err_code Error code that has to be logged along with the
- *                  emergency message
- * \retval ...      Takes as argument(s), a printf style format message
- */
-#define SCLogEmerg(...)                                                                            \
-    SCLogErr(SC_LOG_EMERGENCY, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__)
-
 /* Avoid the overhead of using the debugging subsystem, in production mode */
 #ifndef DEBUG