[dpdk-dev,6/6] eal: fix dump of registered logs when disabled

Message ID 20170418142225.6308-6-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Olivier Matz April 18, 2017, 2:22 p.m. UTC
  When we pass --log-level=0, it disables the logs. This level is
not displayed properly by the function that dumps the registered log
types (it shows "unknown"). Show "disabled" instead.

Before:

  ./build/app/test --log-level=0
  RTE>>dump_log_types
  global log level is unknown
  ...

After:

  ./build/app/test --log-level=0
  RTE>>dump_log_types
  global log level is disabled
  ...

Fixes: 432050bfd05b ("eal: dump registered log types")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 lib/librte_eal/common/eal_common_log.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c
index c2957d167..164078c74 100644
--- a/lib/librte_eal/common/eal_common_log.c
+++ b/lib/librte_eal/common/eal_common_log.c
@@ -294,6 +294,7 @@  static const char *
 loglevel_to_string(uint32_t level)
 {
 	switch (level) {
+	case 0: return "disabled";
 	case RTE_LOG_EMERG: return "emerg";
 	case RTE_LOG_ALERT: return "alert";
 	case RTE_LOG_CRIT: return "critical";