From: Olivier Matz Date: Tue, 18 Apr 2017 14:22:25 +0000 (+0200) Subject: log: fix dump of registered logs when disabled X-Git-Tag: spdx-start~3481 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2fc8e0bf04d804b1c51b3d3a390231a31cecf6b4;p=dpdk.git log: fix dump of registered logs when disabled 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 Acked-by: Ferruh Yigit --- diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index 5f38ca5d9a..ddf65b7fd5 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -309,6 +309,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";