From mboxrd@z Thu Jan 1 00:00:00 1970 From: Neil Horman Subject: Re: [RFC 3/4] eal: add command line option to log output to stdout Date: Wed, 3 Aug 2016 07:25:40 -0400 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 Cc: dev@dpdk.org To: Declan Doherty 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) Content-Disposition: inline In-Reply-To: <1470170269-20721-4-git-send-email-declan.doherty@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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