mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-01 03:15:42 +00:00
Add a verbose mode flag to meshtasticd (#7416)
This commit is contained in:
parent
878d68c5ef
commit
2087629a47
@ -34,6 +34,7 @@ Ch341Hal *ch341Hal = nullptr;
|
|||||||
char *configPath = nullptr;
|
char *configPath = nullptr;
|
||||||
char *optionMac = nullptr;
|
char *optionMac = nullptr;
|
||||||
bool forceSimulated = false;
|
bool forceSimulated = false;
|
||||||
|
bool verboseEnabled = false;
|
||||||
|
|
||||||
const char *argp_program_version = optstr(APP_VERSION);
|
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':
|
case 'h':
|
||||||
optionMac = arg;
|
optionMac = arg;
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
verboseEnabled = true;
|
||||||
|
break;
|
||||||
case ARGP_KEY_ARG:
|
case ARGP_KEY_ARG:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
@ -85,6 +88,7 @@ void portduinoCustomInit()
|
|||||||
{"config", 'c', "CONFIG_PATH", 0, "Full path of the .yaml config file to use."},
|
{"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"},
|
{"hwid", 'h', "HWID", 0, "The mac address to assign to this virtual machine"},
|
||||||
{"sim", 's', 0, 0, "Run in Simulated radio mode"},
|
{"sim", 's', 0, 0, "Run in Simulated radio mode"},
|
||||||
|
{"verbose", 'v', 0, 0, "Set log level to full debug"},
|
||||||
{0}};
|
{0}};
|
||||||
static void *childArguments;
|
static void *childArguments;
|
||||||
static char doc[] = "Meshtastic native build.";
|
static char doc[] = "Meshtastic native build.";
|
||||||
@ -417,6 +421,9 @@ void portduinoSetup()
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (verboseEnabled && settingsMap[logoutputlevel] != level_trace) {
|
||||||
|
settingsMap[logoutputlevel] = level_debug;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user