Early use of log() does not end up in kernel msg buffer

Eric Badger eric at badgerio.us
Fri Mar 27 03:22:11 UTC 2015


Using log(9) when no process is reading the log results in the message 
going only to the console (contrast with printf(9), which goes to the 
console and to the kernel message buffer in this case). I believe 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 put 
into a logfile). I therefore propose the attached patch, which sends 
log(9) to the message buffer always, and to the console only if no one 
has yet opened the log.

It may be more complete to log to the console only if the log level is 
greater than some (user defined) value, but this seems like that might 
be more than necessary for this case.

Thoughts?

Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: log.diff
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20150326/4057fa73/attachment.bin>


More information about the freebsd-current mailing list