From 93ba19d1e16f72c167c3edaae4aa0eae0576cede Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 30 Jul 2024 15:05:33 -0500 Subject: [PATCH] Make LogRecord protobuf serial logging over Phone API opt-in instead (#4358) * Make LogRecord protobuf serial logging over Phone API opt-in instead of enabled by default * debug_log_enabled --- src/SerialConsole.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SerialConsole.cpp b/src/SerialConsole.cpp index 9a9331e47..d25b81da7 100644 --- a/src/SerialConsole.cpp +++ b/src/SerialConsole.cpp @@ -96,7 +96,7 @@ bool SerialConsole::handleToRadio(const uint8_t *buf, size_t len) void SerialConsole::log_to_serial(const char *logLevel, const char *format, va_list arg) { - if (usingProtobufs) { + if (usingProtobufs && config.device.debug_log_enabled) { meshtastic_LogRecord_Level ll = meshtastic_LogRecord_Level_UNSET; // default to unset switch (logLevel[0]) { case 'D': @@ -120,4 +120,4 @@ void SerialConsole::log_to_serial(const char *logLevel, const char *format, va_l emitLogRecord(ll, thread ? thread->ThreadName.c_str() : "", format, arg); } else RedirectablePrint::log_to_serial(logLevel, format, arg); -} \ No newline at end of file +}