X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Feal_common_log.c;h=41ea92472b3319ebd93b2c7f5bc6bf217aae311c;hb=98a7ea332ba3da0f74ec951595d36a616165b255;hp=fcc28a969ba625584be890fb5cc68647b969ead9;hpb=9348ca1602ce9d140a215e92852b4b5fe26a2013;p=dpdk.git diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index fcc28a969b..41ea92472b 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -159,23 +159,27 @@ rte_log_set_level_regexp(const char *pattern, uint32_t level) if (level > RTE_LOG_DEBUG) return -1; + if (regcomp(&r, pattern, 0) != 0) + return -1; + for (i = 0; i < rte_logs.dynamic_types_len; i++) { if (rte_logs.dynamic_types[i].name == NULL) continue; - if (regexec(&r, pattern, 0, NULL, 0) == 0) + if (regexec(&r, rte_logs.dynamic_types[i].name, 0, + NULL, 0) == 0) rte_logs.dynamic_types[i].loglevel = level; } return 0; } -/* get the current loglevel for the message beeing processed */ +/* get the current loglevel for the message being processed */ int rte_log_cur_msg_loglevel(void) { return RTE_PER_LCORE(log_cur_msg).loglevel; } -/* get the current logtype for the message beeing processed */ +/* get the current logtype for the message being processed */ int rte_log_cur_msg_logtype(void) { return RTE_PER_LCORE(log_cur_msg).logtype; @@ -305,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";