Subject: Re: kern/5155: Kernel messages may be way too verbose for some apps.
To: Chris G. Demetriou" , "Erik E. Fair <fair@clock.org>
From: Brian Buhrow <buhrow@cats.ucsc.edu>
List: tech-kern
Date: 03/12/1998 23:21:03
	I was always under the impression that if syslogd was running, printf
in the kernel went to the log device and syslogd could decide wehter or not
to throw it away or write to logs and/or consoles.  I know I have done this
in SunOS to supress messages on the console but to get them on the log
file.  Am I mistaken?
-Brian

On Mar 12,  4:15pm, "Chris G. Demetriou" wrote:
} Subject: Re: kern/5155: Kernel messages may be way too verbose for some ap
} [ 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
>-- End of excerpt from "Chris G. Demetriou"