output: remove unused log levels

Critical, alert and emergency were unused, so remove.
pull/8304/head
Victor Julien 3 years ago
parent 8a3c8984b4
commit 5b58be6076

@ -38,12 +38,9 @@
// 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);

@ -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

Loading…
Cancel
Save