const char *message,
const struct ucred *ucred) {
- struct iovec iovec[5];
+ struct iovec iovec[7];
struct timespec ts;
char tbuf[STRLEN("[] ") + DECIMAL_STR_MAX(ts.tv_sec) + DECIMAL_STR_MAX(ts.tv_nsec)-3 + 1];
char header_pid[STRLEN("[]: ") + DECIMAL_STR_MAX(pid_t)];
_cleanup_free_ char *ident_buf = NULL;
_cleanup_close_ int fd = -EBADF;
- const char *tty;
+ const char *tty, *color_on = "", *color_off = "";
int n = 0;
assert(s);
iovec[n++] = IOVEC_MAKE_STRING(": ");
}
+ get_log_colors(LOG_PRI(priority), &color_on, &color_off, NULL);
+
/* Fourth: message */
+ iovec[n++] = IOVEC_MAKE_STRING(color_on);
iovec[n++] = IOVEC_MAKE_STRING(message);
+ iovec[n++] = IOVEC_MAKE_STRING(color_off);
iovec[n++] = IOVEC_MAKE_STRING("\n");
tty = s->tty_path ?: "/dev/console";