+/*
+ * Log writes to the log buffer,
+ * and guarantees not to sleep (so can be called by interrupt routines).
+ * If there is no process reading the log yet, it writes to the console also.
+ */
+/*VARARGS2*/
+log(level, fmt, x1)
+ char *fmt;
+ unsigned x1;
+{
+ register s = splhigh();
+ extern int log_open;
+
+ logpri(level);
+ prf(fmt, &x1, TOLOG, (struct tty *)0);
+ splx(s);
+ if (!log_open)
+ prf(fmt, &x1, TOCONS, (struct tty *)0);
+ logwakeup();
+}
+
+logpri(level)
+ int level;
+{
+
+ putchar('<', TOLOG, (struct tty *)0);
+ printn((u_long)level, 10, TOLOG, (struct tty *)0);
+ putchar('>', TOLOG, (struct tty *)0);
+}
+
+prf(fmt, adx, flags, ttyp)