[dpdk-dev,1/2] eal: fix legacy dynamic logs defaulting to debug

Message ID 20171116103144.4197-1-pbhagavatula@caviumnetworks.com
State Superseded, archived
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Nov. 16, 2017, 10:31 a.m.
Use RTE_LOG_LEVEL instead of RTE_LOG_DEBUG when registering dynamic logs
for legacy modules.

Fixes: c1b5fa94a46f ("eal: support dynamic log types")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_eal/common/eal_common_log.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index e894b75ec..061e96ef9 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -181,8 +181,11 @@  __rte_log_register(const char *name, int id)
 		return -ENOMEM;
 
 	rte_logs.dynamic_types[id].name = dup_name;
-	rte_logs.dynamic_types[id].loglevel = RTE_LOG_DEBUG;
-
+#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
+	rte_logs.dynamic_types[id].loglevel = RTE_LOG_INFO;
+#else
+	rte_logs.dynamic_types[id].loglevel = RTE_LOG_LEVEL;
+#endif
 	return id;
 }