From: Matthew Hall Date: Sun, 14 Sep 2014 08:34:46 +0000 (-0700) Subject: log: add function to retrieve log level X-Git-Tag: spdx-start~10420 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e9703de76c75fb6ce0c63593724228d945a90c46;p=dpdk.git log: add function to retrieve log level It is helpful when you want outside code to cooperate with and respect log levels set in DPDK. Then you can avoid using duplicate incompatible log code in the DPDK and non-DPDK parts of the app. Signed-off-by: Matthew Hall Acked-by: Bruce Richardson [Thomas: add void to fix function signature] --- diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index e4df0b90a9..cf576195e3 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -176,6 +176,13 @@ rte_set_log_level(uint32_t level) rte_logs.level = (uint32_t)level; } +/* Get global log level */ +uint32_t +rte_get_log_level(void) +{ + return rte_logs.level; +} + /* Set global log type */ void rte_set_log_type(uint32_t type, int enable) diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 565415af16..02cbb14a32 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -129,6 +129,11 @@ int rte_openlog_stream(FILE *f); */ void rte_set_log_level(uint32_t level); +/** + * Get the global log level. + */ +uint32_t rte_get_log_level(void); + /** * Enable or disable the log type. *