printf("\t--service-change-params : change service startup parameters\n");
#endif /* OS_WIN32 */
printf("\t-V : display Suricata version\n");
+ printf("\t-v[v] : increase default Suricata verbosity\n");
#ifdef UNITTESTS
printf("\t-u : run the unittests and exit\n");
printf("\t-U, --unittest-filter=REGEX : filter unittests with a regex\n");
suri->delayed_detect = 0;
suri->daemon = 0;
suri->offline = 0;
+ suri->verbose = 0;
}
static TmEcode PrintVersion()
/* getopt_long stores the option index here. */
int option_index = 0;
- char short_opts[] = "c:TDhi:l:q:d:r:us:S:U:VF:";
+ char short_opts[] = "c:TDhi:l:q:d:r:us:S:U:VF:v";
while ((opt = getopt_long(argc, argv, short_opts, long_opts, &option_index)) != -1) {
switch (opt) {
SetBpfStringFromFile(optarg);
break;
+ case 'v':
+ suri->verbose++;
+ break;
default:
usage(argv[0]);
return TM_ECODE_FAILED;
/* Since our config is now loaded we can finish configurating the
* logging module. */
- SCLogLoadConfig(suri.daemon);
+ SCLogLoadConfig(suri.daemon, suri.verbose);
SCPrintVersion();
return;
}
-void SCLogLoadConfig(int daemon)
+void SCLogLoadConfig(int daemon, int verbose)
{
ConfNode *outputs;
SCLogInitData *sc_lid;
"No default log level set, will use info.");
sc_lid->global_log_level = SC_LOG_NOTICE;
}
+
+ if (verbose) {
+ sc_lid->global_log_level += verbose;
+ if (sc_lid->global_log_level > SC_LOG_LEVEL_MAX)
+ sc_lid->global_log_level = SC_LOG_LEVEL_MAX;
+ }
+
if (ConfGet("logging.default-log-format", &sc_lid->global_log_format) != 1)
sc_lid->global_log_format = SC_LOG_DEF_LOG_FORMAT;
void SCLogRegisterTests(void);
-void SCLogLoadConfig(int daemon);
+void SCLogLoadConfig(int daemon, int verbose);
#endif /* __UTIL_DEBUG_H__ */