From owner-freebsd-hackers Wed Sep 2 18:27:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA15396 for freebsd-hackers-outgoing; Wed, 2 Sep 1998 18:27:17 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA15382 for ; Wed, 2 Sep 1998 18:27:14 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id SAA04220; Wed, 2 Sep 1998 18:26:10 -0700 (PDT) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma004218; Wed Sep 2 18:26:06 1998 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id SAA07413; Wed, 2 Sep 1998 18:26:05 -0700 (PDT) From: Archie Cobbs Message-Id: <199809030126.SAA07413@bubba.whistle.com> Subject: Re: default syslog priority for kernel messages In-Reply-To: <199809030036.RAA00192@usr07.primenet.com> from Terry Lambert at "Sep 3, 98 00:36:14 am" To: tlambert@primenet.com (Terry Lambert) Date: Wed, 2 Sep 1998 18:26:05 -0700 (PDT) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Terry Lambert writes: > > > The only problem is that it's possible to printf from the kernel > > > without logging, and it may frequently be desirable to send a message > > > to the console without logging it. > > > > So then kill syslogd. > > > > Here is the comment in the code: > > > > /* > > * 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. > > */ > > The printf calls are special-use calls. They are not merely the "printf" > that you think should be "log". The "printf" is merely a wrapper for > "kvprintf". > > Instead of putting "log" in those places, if you got rid of "printf", > the correct thing to do would be to call "kvprintf" (not "log"). It depends on what the code writer wanted. I'd say in 99% of the cases, they want to spit out a normal kernel logging message and have it go to syslogd. That's exactly what log() does. The only time I can imagine when you would want kprintf() is if you're doing some debugging with tons & tons of output, or something like that. So in the common case, the right thing to do is replace printf with log. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message