[Listener] Limit the verbose level to a maximum
Same as for Aggregator, the verbose level is limited to 4.
This commit is contained in:
parent
56edcc623a
commit
307a60e6f2
|
@ -87,6 +87,7 @@ enum {MODE_ACTIVE = 'a', MODE_PASSIVE = 'p', MODE_MIXED = 'm'} ;
|
|||
#define VERBOSE_INFO GET_VERBOSE() >= 2
|
||||
#define VERBOSE_CHATTERBOX GET_VERBOSE() >= 3
|
||||
#define VERBOSE_DISPLAY_CAPTURED GET_VERBOSE() >= 4
|
||||
#define MAX_VERBOSE_LEVEL 4
|
||||
|
||||
|
||||
/* Packet header sizes (in bytes) */
|
||||
|
@ -319,7 +320,11 @@ void print_version(void) ;
|
|||
#endif // OWLPS_LISTENER_USES_PTHREAD
|
||||
|
||||
#define INCREMENT_VERBOSE() \
|
||||
(cfg_setint(cfg, "verbose", cfg_getint(cfg, "verbose") + 1))
|
||||
do { \
|
||||
long vlevel = cfg_getint(cfg, "verbose") ; \
|
||||
if (vlevel < MAX_VERBOSE_LEVEL) \
|
||||
cfg_setint(cfg, "verbose", vlevel + 1) ; \
|
||||
} while (0)
|
||||
#define RESET_VERBOSE() \
|
||||
(cfg_setint(cfg, "verbose", 0))
|
||||
#define GET_VERBOSE() \
|
||||
|
@ -431,7 +436,8 @@ void print_version(void) ;
|
|||
#endif // OWLPS_LISTENER_USES_PTHREAD
|
||||
|
||||
#define INCREMENT_VERBOSE() \
|
||||
(++options.verbose)
|
||||
if (options.verbose < MAX_VERBOSE_LEVEL) \
|
||||
++options.verbose
|
||||
#define RESET_VERBOSE() \
|
||||
(options.verbose = 0)
|
||||
#define GET_VERBOSE() \
|
||||
|
|
Loading…
Reference in New Issue