Subject: Re: kern/5155: Kernel messages may be way too verbose for some apps.
To: Erik E. Fair <fair@clock.org>
From: Chris G. Demetriou <cgd@pa.dec.com>
List: tech-kern
Date: 03/12/1998 16:15:03
[ I've cc'd gnats-bugs so that this is appended to the PR. ]

Erik Fair said:
> Isn't this what log() and addlog() in sys/kern/subr_prf.c are for? It
> should be a straightforward matter of changing all those "printf"
> statements to "log" statements with an appropriate log level, no?

No, not at all.

log() is specifically meant to put stuff into the system log, with a
given priority.

What people using NetBSD for 'embedded-ish' (or even 'end-user
desktop') systems want/need is to be able to suppress the normal
kernel printfs.  In some cases they want those printfs to go to the
console, and most other applications (e.g. general OS use) also want
those printfs to go to the console.

log() does not do that.  it _just_ sends things to the system logs.


To do what i'm describing with log(), you'd have to change log() so
that it could optionally print things out (if the messages had higher
level than the 'log threshhold').  Additionally, you'd have to change
just about _all_ of the kernel printfs (excluding the ones that should
_always_ be printed out) to log() calls.

The notion of printf() as it is used now in the kernel (i.e. without a
priority) should go away completely, if you want to solve this problem
"correctly."


cgd