summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSu Wang <su.z.wang@ericsson.com>2019-01-11 12:46:05 -0500
committerDamjan Marion <dmarion@me.com>2019-01-20 14:17:40 +0000
commit34321b3445b77f2624475d18a6483db6fd0d7e94 (patch)
treed0c5739c996f6e9249fbf1b7ac13bf52b33e7b47 /src
parent240c238f25b15c4121cd283292e2424243b7757a (diff)
log: bug fix register class compare mismatch
1. Otherwise, the log classes with same prefix, e.g. "abc" and "abc-de" will all be registered into log class "abc"; 2. Minor improvement for test log help string. Change-Id: I8d93be5e8fa67db6012198b3442a9e2bddcb744a Signed-off-by: Su Wang <su.z.wang@ericsson.com>
Diffstat (limited to 'src')
-rw-r--r--src/vlib/log.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vlib/log.c b/src/vlib/log.c
index 76490fcd3bc..9a0d75fe3ac 100644
--- a/src/vlib/log.c
+++ b/src/vlib/log.c
@@ -232,6 +232,8 @@ vlib_log_register_class (char *class, char *subclass)
vlib_log_class_data_t *tmp;
vec_foreach (tmp, lm->classes)
{
+ if (vec_len (tmp->name) != strlen (class))
+ continue;
if (!memcmp (class, tmp->name, vec_len (tmp->name)))
{
c = tmp;
@@ -689,7 +691,7 @@ test_log_class_subclass (vlib_main_t * vm,
/* *INDENT-OFF* */
VLIB_CLI_COMMAND (cli_test_log, static) = {
.path = "test log",
- .short_help = "test log <class> <subclass> <level> <message",
+ .short_help = "test log <level> <class> <subclass> <message>",
.function = test_log_class_subclass,
};
/* *INDENT-ON* */