[Listener] Switch verbose mode to verbose level
This commit is contained in:
parent
371752ab98
commit
a62387e465
|
@ -192,12 +192,12 @@ void print_version(void) ;
|
|||
(cfg_getfloat(cfg, "my_position_z"))
|
||||
#endif // USE_PTHREAD
|
||||
|
||||
#define SET_VERBOSE() \
|
||||
(cfg_setbool(cfg, "verbose", cfg_true))
|
||||
#define UNSET_VERBOSE() \
|
||||
(cfg_setbool(cfg, "verbose", cfg_false))
|
||||
#define INCREMENT_VERBOSE() \
|
||||
(cfg_setint(cfg, "verbose", cfg_getint(cfg, "verbose") + 1))
|
||||
#define RESET_VERBOSE() \
|
||||
(cfg_setint(cfg, "verbose", 0))
|
||||
#define GET_VERBOSE() \
|
||||
(cfg_getbool(cfg, "verbose"))
|
||||
(cfg_getint(cfg, "verbose"))
|
||||
#define SET_DISPLAY_CAPTURED() \
|
||||
(cfg_setbool(cfg, "display_captured", cfg_true))
|
||||
#define UNSET_DISPLAY_CAPTURED() \
|
||||
|
@ -285,10 +285,10 @@ void print_version(void) ;
|
|||
(options.my_position_z)
|
||||
#endif // USE_PTHREAD
|
||||
|
||||
#define SET_VERBOSE() \
|
||||
(options.verbose = TRUE)
|
||||
#define UNSET_VERBOSE() \
|
||||
(options.verbose = FALSE)
|
||||
#define INCREMENT_VERBOSE() \
|
||||
(++options.verbose)
|
||||
#define RESET_VERBOSE() \
|
||||
(options.verbose = 0)
|
||||
#define GET_VERBOSE() \
|
||||
(options.verbose)
|
||||
#define SET_DISPLAY_CAPTURED() \
|
||||
|
|
|
@ -79,7 +79,7 @@ struct {
|
|||
float my_position_y ;
|
||||
float my_position_z ;
|
||||
#endif // USE_PTHREAD
|
||||
owl_bool verbose ;
|
||||
uint_fast8_t verbose ;
|
||||
owl_bool display_captured ;
|
||||
} options = { // Initalise default options:
|
||||
MODE_ACTIVE,
|
||||
|
@ -101,7 +101,7 @@ struct {
|
|||
DEFAULT_AUTOCALIBRATION_NBPKT,
|
||||
0, 0, 0, 0,
|
||||
#endif // USE_PTHREAD
|
||||
FALSE,
|
||||
0,
|
||||
FALSE
|
||||
} ;
|
||||
#endif // USE_CONFIG_FILE
|
||||
|
@ -307,8 +307,8 @@ void parse_config_file(int argc, char **argv)
|
|||
// Position Z
|
||||
CFG_FLOAT("my_position_z", 0, CFGF_NONE),
|
||||
#endif // USE_PTHREAD
|
||||
// Be verbose, or not:
|
||||
CFG_BOOL("verbose", cfg_false, CFGF_NONE),
|
||||
// Verbose level:
|
||||
CFG_INT("verbose", 0, CFGF_NONE),
|
||||
// Display captured packets, or not:
|
||||
CFG_BOOL("display_captured", cfg_false, CFGF_NONE),
|
||||
CFG_END()
|
||||
|
@ -461,7 +461,7 @@ void parse_main_options(int argc, char **argv)
|
|||
#endif // USE_PTHREAD
|
||||
break ;
|
||||
case 'q' :
|
||||
UNSET_VERBOSE() ;
|
||||
RESET_VERBOSE() ;
|
||||
break ;
|
||||
case 'Q' :
|
||||
UNSET_DISPLAY_CAPTURED() ;
|
||||
|
@ -475,7 +475,7 @@ void parse_main_options(int argc, char **argv)
|
|||
#endif // USE_PTHREAD
|
||||
break ;
|
||||
case 'v' :
|
||||
SET_VERBOSE() ;
|
||||
INCREMENT_VERBOSE() ;
|
||||
break ;
|
||||
case 'V' : // Version
|
||||
break ; // (already parsed)
|
||||
|
|
Loading…
Reference in New Issue