mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +00:00
guard-clause use of syslog object
This commit is contained in:
parent
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user