mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-14 23:02:53 +00:00
Adds ASCII log option needed by portudino (#4443)
* Adds ASCII logs useful to portudino Activates ASCII log option when stdout is not a terminal. This is generally the right thing to do; if not, the behavior can be overridden in config.yaml using AsciiLogs under Logging. The result is reasonable system logs for portudino when running under systemd or the like. Signed-off-by: Christopher Hoover <ch@murgatroid.com>
This commit is contained in:
committed by
GitHub
parent
d398419aef
commit
85176756ec
@@ -99,6 +99,7 @@ void portduinoSetup()
|
||||
settingsStrings[spidev] = "";
|
||||
settingsStrings[displayspidev] = "";
|
||||
settingsMap[spiSpeed] = 2000000;
|
||||
settingsMap[ascii_logs] = !isatty(1);
|
||||
|
||||
YAML::Node yamlConfig;
|
||||
|
||||
@@ -152,6 +153,10 @@ void portduinoSetup()
|
||||
settingsMap[logoutputlevel] = level_error;
|
||||
}
|
||||
settingsStrings[traceFilename] = yamlConfig["Logging"]["TraceFile"].as<std::string>("");
|
||||
if (yamlConfig["Logging"]["AsciiLogs"]) {
|
||||
// Default is !isatty(1) but can be set explicitly in config.yaml
|
||||
settingsMap[ascii_logs] = yamlConfig["Logging"]["AsciiLogs"].as<bool>();
|
||||
}
|
||||
}
|
||||
if (yamlConfig["Lora"]) {
|
||||
settingsMap[use_sx1262] = false;
|
||||
|
||||
Reference in New Issue
Block a user