From owner-svn-src-head@FreeBSD.ORG Thu Nov 7 12:12:09 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1235733E; Thu, 7 Nov 2013 12:12:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BC85528B3; Thu, 7 Nov 2013 12:12:07 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA11999; Thu, 07 Nov 2013 14:11:59 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1VeORL-000JL9-K3; Thu, 07 Nov 2013 14:11:59 +0200 Message-ID: <527B8357.5070200@FreeBSD.org> Date: Thu, 07 Nov 2013 14:11:03 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Alan Somers , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r252481 - in head: etc sbin/devd References: <201307012120.r61LKIxI059332@svn.freebsd.org> In-Reply-To: <201307012120.r61LKIxI059332@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2013 12:12:09 -0000 First, apologies for this very delayed reaction. on 02/07/2013 00:20 Alan Somers said the following: > Author: asomers > Date: Mon Jul 1 21:20:17 2013 > New Revision: 252481 > URL: http://svnweb.freebsd.org/changeset/base/252481 > > Log: > Add syslog(3) support to devd(8). > [snip] > @@ -243,8 +244,7 @@ bool > action::do_action(config &c) > { > string s = c.expand_string(_cmd.c_str()); > - if (Dflag) > - fprintf(stderr, "Executing '%s'\n", s.c_str()); > + devdlog(LOG_NOTICE, "Executing '%s'\n", s.c_str()); My opinion that this message does not deserve LOG_NOTICE message. LOG_NOTICE Conditions that are not error conditions, but should possi‐ bly be handled specially. I don't think that devd reacting to an event deserves any special handling from an administrator. All LOG_NOTICE messages are logged into /var/log/messages by default. Besides, many actions already explicitly call logger(1) and sometimes that's the only thing that they do. So on a system with default syslog configuration one can see messages like: devd: Executing 'logger Unknown USB device: vendor 0x03f0 product 0x102a bus uhub7' root: Unknown USB device: vendor 0x03f0 product 0x102a bus uhub7 I think that LOG_INFO should be fine for these messages. > my_system(s.c_str()); > return (true); > } > @@ -1078,10 +1090,27 @@ gensighand(int) > romeo_must_die = 1; > } > > +/* > + * Local logging function. Prints to syslog if we're daemonized; syslog > + * otherwise. > + */ Minor nit: there is a typo in this comment. > +static void > +devdlog(int priority, const char* fmt, ...) > +{ > + va_list argp; > + > + va_start(argp, fmt); > + if (dflag) > + vfprintf(stderr, fmt, argp); > + else > + vsyslog(priority, fmt, argp); > + va_end(argp); > +} > + -- Andriy Gapon