From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 021C42BB1 for ; Wed, 3 Aug 2016 13:26:05 +0200 (CEST) Received: from cpe-2606-a000-111b-40ed-7aac-c0ff-fec2-933b.dyn6.twc.com ([2606:a000:111b:40ed:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1bUuJ3-0003nD-4v; Wed, 03 Aug 2016 07:25:59 -0400 Date: Wed, 3 Aug 2016 07:25:40 -0400 From: Neil Horman To: Declan Doherty Cc: dev@dpdk.org Message-ID: <20160803112540.GA3603@hmsreliant.think-freely.org> References: <1470170269-20721-1-git-send-email-declan.doherty@intel.com> <1470170269-20721-4-git-send-email-declan.doherty@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470170269-20721-4-git-send-email-declan.doherty@intel.com> User-Agent: Mutt/1.6.2 (2016-07-01) X-Spam-Score: -1.0 (-) X-Spam-Status: No Subject: Re: [dpdk-dev] [RFC 3/4] eal: add command line option to log output to stdout X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 11:26:06 -0000 On Tue, Aug 02, 2016 at 09:37:48PM +0100, Declan Doherty wrote: > Adds new command line options which allows the user to stop > application echoing log output to stdout, logs are still > written to syslog. > > Signed-off-by: Declan Doherty > --- > lib/librte_eal/common/eal_common_log.c | 14 ++++++++++++++ > lib/librte_eal/common/eal_common_options.c | 8 ++++++++ > lib/librte_eal/common/eal_options.h | 2 ++ > lib/librte_eal/common/include/rte_log.h | 15 +++++++++++++++ > lib/librte_eal/linuxapp/eal/eal.c | 1 + > lib/librte_eal/linuxapp/eal/eal_log.c | 23 ++++++++++++++--------- > 6 files changed, 54 insertions(+), 9 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c > index 7916c78..8319823 100644 > --- a/lib/librte_eal/common/eal_common_log.c > +++ b/lib/librte_eal/common/eal_common_log.c > @@ -45,6 +45,7 @@ > struct rte_logs rte_logs = { > .type = ~0, > .level = RTE_LOG_DEBUG, > + .silent = 1, > .file = NULL, > }; > > @@ -102,6 +103,18 @@ rte_get_log_level(void) > return rte_logs.level; > } > > +void > +rte_log_silence_stdout(void) > +{ > + rte_logs.silent = 0; > +} > + > +int > +rte_log_stdout(void) > +{ > + return rte_logs.silent; Maybe you want to return !rte_logs.silent? That way the sense of the actual variable makes human readable sense. i.e. currently rte_logs.silent is set to 1 if you want to print to stdout, which seems backwards Neil