diff --git a/TODO.t2t b/TODO.t2t index 35bfd61..53674bf 100644 --- a/TODO.t2t +++ b/TODO.t2t @@ -81,8 +81,6 @@ Work to do in OwlPS - Option to overwrite the output file (ask for a confirmation!). -- Test for the maximum verbose level. - - Outputs should include all the timestamps The CSV output file and the socket should include the capture diff --git a/owlps-aggregator/owlps-aggregator.h b/owlps-aggregator/owlps-aggregator.h index 1978184..7c418a3 100644 --- a/owlps-aggregator/owlps-aggregator.h +++ b/owlps-aggregator/owlps-aggregator.h @@ -43,6 +43,7 @@ #define VERBOSE_INFO cfg_getint(cfg, "verbose") >= 2 #define VERBOSE_CHATTERBOX cfg_getint(cfg, "verbose") >= 3 #define VERBOSE_REQUESTS cfg_getint(cfg, "verbose") >= 4 +#define MAX_VERBOSE_LEVEL 4 /* Linked list storing data of each request */ diff --git a/owlps-aggregator/owlps-aggregatord.c b/owlps-aggregator/owlps-aggregatord.c index 54b241f..8a63773 100644 --- a/owlps-aggregator/owlps-aggregatord.c +++ b/owlps-aggregator/owlps-aggregatord.c @@ -453,9 +453,11 @@ int parse_command_line(const int argc, char *const *argv) " failing back to the default value.\n") ; break ; case 'v' : - // Increment the verbose level - cfg_setint(cfg, "verbose", - cfg_getint(cfg, "verbose") + 1) ; + { // Increment the verbose level if the maximum is not reached + long vlevel = cfg_getint(cfg, "verbose") ; + if (vlevel < MAX_VERBOSE_LEVEL) + cfg_setint(cfg, "verbose", vlevel + 1) ; + } break ; default : print_usage() ;