From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 9A072C400 for ; Sun, 2 Aug 2015 23:23:58 +0200 (CEST) Received: by wibxm9 with SMTP id xm9so96601181wib.0 for ; Sun, 02 Aug 2015 14:23:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=2QFOc/jDZ77H+v1xUk1m0zaaNuTMe3Vcq0yWEYOMa9c=; b=FmtDdifnPAThReNPFelbGLU4ADacnZE4g/PWEUx9pCwmLY0oC5aN3B49edmaE9v3hI 31aHGJGVttMnd4yP/E5enA7QC4fthxg178rri3feypv6mTVLq0do2xdqtNlIuNZt7nre m59spnPT/JzJrgGycfzr7JZ60pXDVeSQyHuHsf5TWyLZxLzvqvu2FFFtf4SU56HP83fZ ULfwBkMaBCtkGvh6IgqH5aI3MnI6Px//ny5CSkgBAdOJNOenW32t+SOOO1W07Sa3xZep P5unMemzQYB/xwoLWQEHcWNNTj0sD+n83l6vIPrGnOmKb/0OzxZ4ECPUjlc5NbJrq4C8 HPhw== X-Gm-Message-State: ALoCoQm73hMAHdUqeykqCVK+9k17ow25ZE4DenXjYYDcguiTEBSHVQgnG1mmCoamFXqBio2ban6v X-Received: by 10.194.2.228 with SMTP id 4mr26217266wjx.146.1438550638409; Sun, 02 Aug 2015 14:23:58 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id gj6sm10027762wib.22.2015.08.02.14.23.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 14:23:57 -0700 (PDT) From: Thomas Monjalon To: "Wiles, Keith" Date: Sun, 02 Aug 2015 23:22:43 +0200 Message-ID: <1837033.QofH5s9LVq@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: References: <1433635446-78275-1-git-send-email-keith.wiles@intel.com> <4594355.leWO83I6KL@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] log:Change magic number on RTE_LOG_LEVEL to a define 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: Sun, 02 Aug 2015 21:23:58 -0000 2015-08-02 20:58, Wiles, Keith: > On 8/2/15, 3:44 PM, "Thomas Monjalon" wrote: > > >2015-08-02 19:10, Wiles, Keith: > >> On 8/2/15, 12:15 PM, "Thomas Monjalon" > >>wrote: > >> >2015-06-06 19:04, Keith Wiles: > >> >> +# Log level use: RTE_LOG_XXX > >> >> +# XXX = NOOP, EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO or > >>DEBUG > >> >> +# Look in rte_log.h for others if any. > >> >> +# > >> > > >> >I think this comment is useless. > >> > >> I do not think the comment is useless as some may not understand what > >> values the Log level can be set too in the future. Not commenting the > >> change would be a problem IMO. This is also why the line was moved. > > > >It is already documented in the API doc. > >I agree having some comments in the config files would be convenient but: > > - this one is 3 lines long > > - currently comments are only used to separate sections > >Maybe you can do a oneline: > > # Minimum log level compiled: DEBUG, INFO, NOTICE, WARNING or ERR > >I think it is important to tell it is a minimum log level, i.e. compiled > >logs. > >And probably it is not needed to suggest a minimum level higher than ERR. > > I will reduce the comment to one line, should I move the LOG_HISTORY down > to under LOG_LEVEL? Yes please. > >> >> + RTE_LOG_EMERG, /**< System is unusable. */ > >> >> + RTE_LOG_ALERT, /**< Action must be taken immediately. */ > >> >> + RTE_LOG_CRIT, /**< Critical conditions. */ > >> >> + RTE_LOG_ERR, /**< Error conditions. */ > >> >> + RTE_LOG_WARNING, /**< Warning conditions. */ > >> >> + RTE_LOG_NOTICE, /**< Normal but significant condition. */ > >> >> + RTE_LOG_INFO, /**< Informational. */ > >> >> + RTE_LOG_DEBUG /**< Debug-level messages. */ > >> >> +}; > >> > > >> >What is the benefit of this change? > >> > >> The change is to use a enum in place of using magic numbers, plus you > >>get > >> the benefit of seeing the enum name in the debugger instead of a number. > >> It makes the code more readable IMHO. > > > >OK so a comment in the commit message could give the debugger > >justification. > > OK will add the debugger comment to the commit log. Thanks Please also explain that rte_logs was set after options parsing, defaulting to RTE_LOG_LEVEL, and it is now initialized at RTE_LOG_LEVEL without behavioral change.