sforkowany z mirror/meshtastic-firmware
guard-clause use of syslog object
rodzic
090d399843
commit
5b75abc6f7
|
@ -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);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue