[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_INFO GET_VERBOSE() >= 2
|
||||||
#define VERBOSE_CHATTERBOX GET_VERBOSE() >= 3
|
#define VERBOSE_CHATTERBOX GET_VERBOSE() >= 3
|
||||||
#define VERBOSE_DISPLAY_CAPTURED GET_VERBOSE() >= 4
|
#define VERBOSE_DISPLAY_CAPTURED GET_VERBOSE() >= 4
|
||||||
|
#define MAX_VERBOSE_LEVEL 4
|
||||||
|
|
||||||
|
|
||||||
/* Packet header sizes (in bytes) */
|
/* Packet header sizes (in bytes) */
|
||||||
|
@ -318,8 +319,12 @@ void print_version(void) ;
|
||||||
(cfg_getfloat(cfg, "my_position_z"))
|
(cfg_getfloat(cfg, "my_position_z"))
|
||||||
#endif // OWLPS_LISTENER_USES_PTHREAD
|
#endif // OWLPS_LISTENER_USES_PTHREAD
|
||||||
|
|
||||||
#define INCREMENT_VERBOSE() \
|
#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() \
|
#define RESET_VERBOSE() \
|
||||||
(cfg_setint(cfg, "verbose", 0))
|
(cfg_setint(cfg, "verbose", 0))
|
||||||
#define GET_VERBOSE() \
|
#define GET_VERBOSE() \
|
||||||
|
@ -430,8 +435,9 @@ void print_version(void) ;
|
||||||
(options.my_position_z)
|
(options.my_position_z)
|
||||||
#endif // OWLPS_LISTENER_USES_PTHREAD
|
#endif // OWLPS_LISTENER_USES_PTHREAD
|
||||||
|
|
||||||
#define INCREMENT_VERBOSE() \
|
#define INCREMENT_VERBOSE() \
|
||||||
(++options.verbose)
|
if (options.verbose < MAX_VERBOSE_LEVEL) \
|
||||||
|
++options.verbose
|
||||||
#define RESET_VERBOSE() \
|
#define RESET_VERBOSE() \
|
||||||
(options.verbose = 0)
|
(options.verbose = 0)
|
||||||
#define GET_VERBOSE() \
|
#define GET_VERBOSE() \
|
||||||
|
|
Loading…
Reference in New Issue