|
|
@ -391,11 +391,11 @@ syslog_compose(uint8_t facility, uint8_t severity, const char *tag, const char * |
|
|
|
} sl; |
|
|
|
} sl; |
|
|
|
|
|
|
|
|
|
|
|
DBG("[%dµs] %s id=%lu\n", WDEV_NOW(), __FUNCTION__, syslog_msgid); |
|
|
|
DBG("[%dµs] %s id=%lu\n", WDEV_NOW(), __FUNCTION__, syslog_msgid); |
|
|
|
|
|
|
|
syslog_entry_t *se = os_zalloc(sizeof (syslog_entry_t) + 1024); // allow up to 1k datagram
|
|
|
|
sl.se.next = NULL; |
|
|
|
if (se == NULL) return NULL; |
|
|
|
sl.se.msgid = syslog_msgid; |
|
|
|
char *p = se->datagram; |
|
|
|
sl.se.tick = WDEV_NOW(); // 0 ... 4294.967295s
|
|
|
|
se->tick = WDEV_NOW(); // 0 ... 4294.967295s
|
|
|
|
char *p = sl.se.datagram; |
|
|
|
se->msgid = syslog_msgid; |
|
|
|
|
|
|
|
|
|
|
|
// The Priority value is calculated by first multiplying the Facility
|
|
|
|
// The Priority value is calculated by first multiplying the Facility
|
|
|
|
// number by 8 and then adding the numerical value of the Severity.
|
|
|
|
// number by 8 and then adding the numerical value of the Severity.
|
|
|
@ -527,6 +527,7 @@ void ICACHE_FLASH_ATTR syslog(uint8_t facility, uint8_t severity, const char *ta |
|
|
|
// compose the syslog message
|
|
|
|
// compose the syslog message
|
|
|
|
void *arg = __builtin_apply_args(); |
|
|
|
void *arg = __builtin_apply_args(); |
|
|
|
void *res = __builtin_apply((void*)syslog_compose, arg, 128); |
|
|
|
void *res = __builtin_apply((void*)syslog_compose, arg, 128); |
|
|
|
|
|
|
|
if (res == NULL) return; // compose failed, probably due to malloc failure
|
|
|
|
syslog_entry_t *se = *(syslog_entry_t **)res; |
|
|
|
syslog_entry_t *se = *(syslog_entry_t **)res; |
|
|
|
|
|
|
|
|
|
|
|
// and append it to the message queue
|
|
|
|
// and append it to the message queue
|
|
|
|