* [dpdk-dev] [PATCH] rte_log.h: display level in logs from RTE_LOG
@ 2015-11-13 5:50 Matthew Hall
2015-11-13 13:11 ` Panu Matilainen
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Hall @ 2015-11-13 5:50 UTC (permalink / raw)
To: dev
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
lib/librte_eal/common/include/rte_log.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
index ede0dca..be961d0 100644
--- a/lib/librte_eal/common/include/rte_log.h
+++ b/lib/librte_eal/common/include/rte_log.h
@@ -297,10 +297,10 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
* - 0: Success.
* - Negative on error.
*/
-#define RTE_LOG(l, t, ...) \
- (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \
- rte_log(RTE_LOG_ ## l, \
- RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \
+#define RTE_LOG(l, t, ...) \
+ (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \
+ rte_log(RTE_LOG_ ## l, \
+ RTE_LOGTYPE_ ## t, # t ": " #l ": " __VA_ARGS__) : \
0)
#ifdef __cplusplus
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] rte_log.h: display level in logs from RTE_LOG
2015-11-13 5:50 [dpdk-dev] [PATCH] rte_log.h: display level in logs from RTE_LOG Matthew Hall
@ 2015-11-13 13:11 ` Panu Matilainen
2015-11-13 16:41 ` Stephen Hemminger
0 siblings, 1 reply; 4+ messages in thread
From: Panu Matilainen @ 2015-11-13 13:11 UTC (permalink / raw)
To: Matthew Hall, dev
On 11/13/2015 07:50 AM, Matthew Hall wrote:
> Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
> ---
> lib/librte_eal/common/include/rte_log.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> index ede0dca..be961d0 100644
> --- a/lib/librte_eal/common/include/rte_log.h
> +++ b/lib/librte_eal/common/include/rte_log.h
> @@ -297,10 +297,10 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
> * - 0: Success.
> * - Negative on error.
> */
> -#define RTE_LOG(l, t, ...) \
> - (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \
> - rte_log(RTE_LOG_ ## l, \
> - RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \
> +#define RTE_LOG(l, t, ...) \
> + (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \
> + rte_log(RTE_LOG_ ## l, \
> + RTE_LOGTYPE_ ## t, # t ": " #l ": " __VA_ARGS__) : \
> 0)
>
> #ifdef __cplusplus
>
+1 for this, makes it much easier to spot the actually important
messages from all the other noise. Both visually and programmatically.
- Panu -
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] rte_log.h: display level in logs from RTE_LOG
2015-11-13 13:11 ` Panu Matilainen
@ 2015-11-13 16:41 ` Stephen Hemminger
2015-11-13 19:18 ` Matthew Hall
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2015-11-13 16:41 UTC (permalink / raw)
To: Panu Matilainen; +Cc: dev
On Fri, 13 Nov 2015 15:11:09 +0200
Panu Matilainen <pmatilai@redhat.com> wrote:
> On 11/13/2015 07:50 AM, Matthew Hall wrote:
> > Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
> > ---
> > lib/librte_eal/common/include/rte_log.h | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h
> > index ede0dca..be961d0 100644
> > --- a/lib/librte_eal/common/include/rte_log.h
> > +++ b/lib/librte_eal/common/include/rte_log.h
> > @@ -297,10 +297,10 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap)
> > * - 0: Success.
> > * - Negative on error.
> > */
> > -#define RTE_LOG(l, t, ...) \
> > - (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \
> > - rte_log(RTE_LOG_ ## l, \
> > - RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \
> > +#define RTE_LOG(l, t, ...) \
> > + (void)((RTE_LOG_ ## l <= RTE_LOG_LEVEL) ? \
> > + rte_log(RTE_LOG_ ## l, \
> > + RTE_LOGTYPE_ ## t, # t ": " #l ": " __VA_ARGS__) : \
> > 0)
> >
> > #ifdef __cplusplus
> >
>
> +1 for this, makes it much easier to spot the actually important
> messages from all the other noise. Both visually and programmatically.
>
> - Panu -
-1
This is already done by syslog and friends and adds more cruft to log messages.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] rte_log.h: display level in logs from RTE_LOG
2015-11-13 16:41 ` Stephen Hemminger
@ 2015-11-13 19:18 ` Matthew Hall
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Hall @ 2015-11-13 19:18 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: dev
On Fri, Nov 13, 2015 at 08:41:43AM -0800, Stephen Hemminger wrote:
> -1
> This is already done by syslog and friends and adds more cruft to log messages.
On the console it is not.
Matthew.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-13 19:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 5:50 [dpdk-dev] [PATCH] rte_log.h: display level in logs from RTE_LOG Matthew Hall
2015-11-13 13:11 ` Panu Matilainen
2015-11-13 16:41 ` Stephen Hemminger
2015-11-13 19:18 ` Matthew Hall
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).