guard-clause use of syslog object

wio-e5
Thomas Göttgens 2023-02-01 15:25:25 +01:00
rodzic 090d399843
commit 5b75abc6f7
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -13,7 +13,9 @@
*/
NoopPrint noopPrint;
#if HAS_WIFI || HAS_ETHERNET
extern Syslog syslog;
#endif
void RedirectablePrint::setDestination(Print *_dest)
{
@ -99,6 +101,7 @@ size_t RedirectablePrint::log(const char *logLevel, const char *format, ...)
}
r += vprintf(format, arg);
#if HAS_WIFI || HAS_ETHERNET
// if syslog is in use, collect the log messages and send them to syslog
if (syslog.isEnabled()) {
int ll = 0;
@ -123,6 +126,7 @@ size_t RedirectablePrint::log(const char *logLevel, const char *format, ...)
}
syslog.vlogf(ll, format, arg);
}
#endif
va_end(arg);