Browse Source

Add the ability to enable/disable per-device stats on the fly and match logging on/off.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
6f769e0f8f
  1. 16
      main.c

16
main.c

@ -2318,13 +2318,14 @@ static void display_options(void)
immedok(logwin, true); immedok(logwin, true);
retry: retry:
clear_logwin(); clear_logwin();
wlogprint("\n[D]ebug:%s [Q]uiet:%s [V]erbose:%s [R]PC debug:%s [L]og interval:%d\n", wlogprint("[N]ormal [C]lear [S]ilent mode (disable all output)\n");
wlogprint("[D]ebug:%s\n[P]er-device:%s\n[Q]uiet:%s\n[V]erbose:%s\n[R]PC debug:%s\n[L]og interval:%d\n",
opt_debug ? "on" : "off", opt_debug ? "on" : "off",
want_per_device_stats? "on" : "off",
opt_quiet ? "on" : "off", opt_quiet ? "on" : "off",
opt_log_output ? "on" : "off", opt_log_output ? "on" : "off",
opt_protocol ? "on" : "off", opt_protocol ? "on" : "off",
opt_log_interval); opt_log_interval);
wlogprint("[N]ormal [C]lear [S]ilent mode (disable all output)\n");
wlogprint("Select an option or any other key to return\n"); wlogprint("Select an option or any other key to return\n");
input = getch(); input = getch();
if (!strncasecmp(&input, "q", 1)) { if (!strncasecmp(&input, "q", 1)) {
@ -2342,16 +2343,21 @@ retry:
opt_debug = false; opt_debug = false;
opt_quiet = false; opt_quiet = false;
opt_protocol = false; opt_protocol = false;
want_per_device_stats = false;
clear_logwin(); clear_logwin();
wlogprint("Output mode reset to normal\n"); wlogprint("Output mode reset to normal\n");
} else if (!strncasecmp(&input, "d", 1)) { } else if (!strncasecmp(&input, "d", 1)) {
opt_debug ^= true; opt_debug ^= true;
if (opt_debug) { opt_log_output = opt_debug;
opt_log_output = true; if (opt_debug)
opt_quiet = false; opt_quiet = false;
}
clear_logwin(); clear_logwin();
wlogprint("Debug mode %s\n", opt_debug ? "enabled" : "disabled"); wlogprint("Debug mode %s\n", opt_debug ? "enabled" : "disabled");
} else if (!strncasecmp(&input, "p", 1)) {
want_per_device_stats ^= true;
opt_log_output = want_per_device_stats;
clear_logwin();
wlogprint("Per-device stats %s\n", want_per_device_stats ? "enabled" : "disabled");
} else if (!strncasecmp(&input, "r", 1)) { } else if (!strncasecmp(&input, "r", 1)) {
opt_protocol ^= true; opt_protocol ^= true;
if (opt_protocol) if (opt_protocol)

Loading…
Cancel
Save