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
This commit is contained in:
Ben Meadors 2024-07-30 15:05:33 -05:00 committed by GitHub
parent a1c998e7e0
commit 93ba19d1e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
}