1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-04 11:04:26 +00:00

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

This commit is contained in:
Con Kolivas 2011-08-18 22:17:55 +10:00
parent e414490bf7
commit 6f769e0f8f

16
main.c
View File

@ -2318,13 +2318,14 @@ static void display_options(void)
immedok(logwin, true);
retry:
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",
want_per_device_stats? "on" : "off",
opt_quiet ? "on" : "off",
opt_log_output ? "on" : "off",
opt_protocol ? "on" : "off",
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");
input = getch();
if (!strncasecmp(&input, "q", 1)) {
@ -2342,16 +2343,21 @@ retry:
opt_debug = false;
opt_quiet = false;
opt_protocol = false;
want_per_device_stats = false;
clear_logwin();
wlogprint("Output mode reset to normal\n");
} else if (!strncasecmp(&input, "d", 1)) {
opt_debug ^= true;
if (opt_debug) {
opt_log_output = true;
opt_log_output = opt_debug;
if (opt_debug)
opt_quiet = false;
}
clear_logwin();
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)) {
opt_protocol ^= true;
if (opt_protocol)