From 2087629a474c4b0b2d7a60995ce3b9b599b72c91 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 22 Jul 2025 06:22:23 -0500 Subject: [PATCH] Add a verbose mode flag to meshtasticd (#7416) --- src/platform/portduino/PortduinoGlue.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 685f0d077..5f99ec2c3 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -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; }