From c207ff9319ebf3f3a456fb67b47cb23d183ccb59 Mon Sep 17 00:00:00 2001 From: Eric van Gyzen Date: Mon, 20 Apr 2015 20:03:26 +0000 Subject: [PATCH] Always send log(9) messages to the message buffer. It is truer to the semantics of logging for messages to *always* go to the message buffer, where they can eventually be collected and, in fact, be put into a log file. This restores the behavior prior to r70239, which seems to have changed it inadvertently. Submitted by: Eric Badger Reviewed by: jhb Approved by: kib (mentor) Obtained from: Dell Inc. MFC after: 1 week --- share/man/man9/printf.9 | 3 ++- sys/kern/subr_prf.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man9/printf.9 b/share/man/man9/printf.9 index 84ac822da02..505ea9b80a2 100644 --- a/share/man/man9/printf.9 +++ b/share/man/man9/printf.9 @@ -67,7 +67,8 @@ The .Fn log function sends the message to the kernel logging facility, using the log level as indicated by -.Fa pri . +.Fa pri , +and to the console if no process is yet reading the log. .Pp Each of these related functions use the .Fa fmt diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 7e6fd091753..65095228083 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -295,7 +295,7 @@ log(int level, const char *fmt, ...) va_list ap; va_start(ap, fmt); - (void)_vprintf(level, log_open ? TOLOG : TOCONS, fmt, ap); + (void)_vprintf(level, log_open ? TOLOG : TOCONS | TOLOG, fmt, ap); va_end(ap); msgbuftrigger = 1;