Add a verbose mode flag to meshtasticd (#7416)

This commit is contained in:
Jonathan Bennett 2025-07-22 06:22:23 -05:00 committed by GitHub
parent 878d68c5ef
commit 2087629a47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,7 @@ Ch341Hal *ch341Hal = nullptr;
char *configPath = nullptr;
char *optionMac = nullptr;
bool forceSimulated = false;
bool verboseEnabled = false;
const char *argp_program_version = optstr(APP_VERSION);
@ -70,7 +71,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
case 'h':
optionMac = arg;
break;
case 'v':
verboseEnabled = true;
break;
case ARGP_KEY_ARG:
return 0;
default:
@ -85,6 +88,7 @@ void portduinoCustomInit()
{"config", 'c', "CONFIG_PATH", 0, "Full path of the .yaml config file to use."},
{"hwid", 'h', "HWID", 0, "The mac address to assign to this virtual machine"},
{"sim", 's', 0, 0, "Run in Simulated radio mode"},
{"verbose", 'v', 0, 0, "Set log level to full debug"},
{0}};
static void *childArguments;
static char doc[] = "Meshtastic native build.";
@ -417,6 +421,9 @@ void portduinoSetup()
exit(EXIT_FAILURE);
}
}
if (verboseEnabled && settingsMap[logoutputlevel] != level_trace) {
settingsMap[logoutputlevel] = level_debug;
}
return;
}