reinstate Serializer for JSOB based logging. Portduino only. Uses external JSON-Cpp lib.

This commit is contained in:
Thomas Göttgens
2026-04-13 21:47:46 +02:00
parent 84ac28a607
commit 2d754b8e4b
17 changed files with 648 additions and 10 deletions
+14 -2
View File
@@ -285,8 +285,20 @@ void RedirectablePrint::log(const char *logLevel, const char *format, ...)
newFormat[len + 1] = '\0';
#if ARCH_PORTDUINO
if (portduino_config.logoutputlevel < level_trace && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_TRACE) == 0) {
return;
// level trace is special, two possible ways to handle it.
if (strcmp(logLevel, MESHTASTIC_LOG_LEVEL_TRACE) == 0) {
if (portduino_config.traceFilename != "") {
va_list arg;
va_start(arg, format);
try {
traceFile << va_arg(arg, char *) << std::endl;
} catch (const std::ios_base::failure &e) {
}
va_end(arg);
}
if (portduino_config.logoutputlevel < level_trace && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_TRACE) == 0) {
return;
}
}
if (portduino_config.logoutputlevel < level_debug && strcmp(logLevel, MESHTASTIC_LOG_LEVEL_DEBUG) == 0) {
return;