syslogd swallows new-lines, which makes multi-line messages otherwise
difficult to read.
[VLL_WARN] = LOG_WARNING,
[VLL_DBG] = LOG_DEBUG,
};
+ char *line, *save_ptr;
- syslog(syslog_levels[level], "%s", s + time_len);
+ for (line = strtok_r(s + time_len, "\n", &save_ptr); line != NULL;
+ line = strtok_r(NULL, "\n", &save_ptr)) {
+ syslog(syslog_levels[level], "%s", line);
+ }
}
errno = save_errno;
}