DPDK patches and discussions
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Declan Doherty <declan.doherty@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC 3/4] eal: add command line option to log output to stdout
Date: Wed, 3 Aug 2016 07:25:40 -0400	[thread overview]
Message-ID: <20160803112540.GA3603@hmsreliant.think-freely.org> (raw)
In-Reply-To: <1470170269-20721-4-git-send-email-declan.doherty@intel.com>

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 <declan.doherty@intel.com>
> ---
>  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

  reply	other threads:[~2016-08-03 11:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 20:37 [dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework Declan Doherty
2016-08-02 20:37 ` [dpdk-dev] [RFC 1/4] mk: Add support for C++ compilation Declan Doherty
2016-08-02 20:37 ` [dpdk-dev] [RFC 2/4] examples: add c++ example application Declan Doherty
2016-08-02 20:37 ` [dpdk-dev] [RFC 3/4] eal: add command line option to log output to stdout Declan Doherty
2016-08-03 11:25   ` Neil Horman [this message]
2016-08-02 20:37 ` [dpdk-dev] [RFC 4/4] app/test-gtest: example google test application Declan Doherty
2016-08-02 21:52 ` [dpdk-dev] [RFC 0/4] Use Google Test as DPDK unit test framework Thomas Monjalon
2016-08-03  9:16   ` Remy Horton
2016-08-03  9:57   ` Doherty, Declan
2016-08-03 12:51     ` Neil Horman
2016-08-03 20:46     ` Ming Zhao
2016-08-04 19:47       ` Jim Murphy
2016-08-04 19:55         ` Wiles, Keith
2016-08-05  7:42           ` Thomas Monjalon
2016-08-05  7:41     ` Yerden Zhumabekov
2016-08-05  9:11       ` Remy Horton
2016-08-05 12:59         ` Neil Horman
2016-08-05 14:54           ` Remy Horton
2016-08-03 11:31   ` Neil Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160803112540.GA3603@hmsreliant.think-freely.org \
    --to=nhorman@tuxdriver.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).