main/options: display level name, not numeric

Issue: 7389

Follow-up change for verbose handling. Instead of displaying the numeric
verbose level, display the level name.

I.e., instead of 4, display Debug
pull/14497/head
Jeff Lucovsky 7 months ago committed by Victor Julien
parent a53ba4af94
commit e80e881335

@ -121,6 +121,7 @@
#include "util-device-private.h"
#include "util-dpdk.h"
#include "util-ebpf.h"
#include "util-enum.h"
#include "util-exception-policy.h"
#include "util-host-os-info.h"
#include "util-hugepages.h"
@ -3066,7 +3067,8 @@ void SuricataInit(void)
SCLogInfo("Running suricata under test mode");
if (suricata.verbose) {
SCLogInfo("Running with verbose level %d", suricata.verbose);
SCLogInfo(
"Running with verbose level %s", SCLogLevel2Name(suricata.verbose + SC_LOG_NOTICE));
}
if (ParseInterfacesList(suricata.aux_run_mode, suricata.pcap_dev) != TM_ECODE_OK) {

@ -1068,6 +1068,11 @@ static inline void SCLogSetLogLevel(SCLogInitData *sc_lid, SCLogConfig *sc_lc)
sc_log_global_log_level = sc_lc->log_level;
}
const char *SCLogLevel2Name(const SCLogLevel lvl)
{
return SCMapEnumValueToName(lvl, sc_log_level_map);
}
SCLogLevel SCLogGetLogLevel(void)
{
return sc_log_global_log_level;

@ -25,6 +25,7 @@
#define SURICATA_UTIL_DEBUG_H
#include "util-error.h"
#include "util-enum.h"
/**
* \brief The various log levels
@ -44,6 +45,8 @@ typedef enum {
SC_LOG_LEVEL_MAX,
} SCLogLevel;
extern const char *SCLogLevel2Name(const SCLogLevel lvl);
SCError SCLogMessage(const SCLogLevel, const char *, const unsigned int, const char *, const char *,
const char *message);

Loading…
Cancel
Save