aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluoyaozu <luoyaozu@foxmail.com>2022-11-23 15:59:17 +0800
committerDamjan Marion <dmarion@0xa5.net>2023-03-06 18:00:04 +0000
commit2d3da8054bab654f36c26a04557c073b12594530 (patch)
treeda55143de71ffcd6e340733dc57799565157cd50
parent79cb1d53c1d713dd731dc58c5338684d8d806680 (diff)
vlib: fix vlib_log for elog
test output before fix: DBGvpp# event-logger clear DBGvpp# test log warn cli log test-log for-elog cli/log [warn ]: test-log for-elog DBGvpp# test log info cli log test-log for-elog cli/log [info ]: test-log for-elog DBGvpp# show event-logger 2 of 131072 events in buffer, logger running 53.022586433: log-notice: test-log for-elog 60.318329361: log-debug: test-log for-elog DBGvpp# test output after fix: DBGvpp# event-logger clear DBGvpp# test log warn cli log test-log for-elog cli/log [warn ]: test-log for-elog DBGvpp# test log info cli log test-log for-elog cli/log [info ]: test-log for-elog DBGvpp# show event-logger 2 of 131072 events in buffer, logger running 18.362721151: log-warn: test-log for-elog 25.124570555: log-info: test-log for-elog DBGvpp# Type: fix Signed-off-by: luoyaozu <luoyaozu@foxmail.com> Change-Id: Ie1122787f9efb611cdafc671b4ccf68b43984924
-rw-r--r--src/vlib/log.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/vlib/log.c b/src/vlib/log.c
index d084511a647..f176062fd0c 100644
--- a/src/vlib/log.c
+++ b/src/vlib/log.c
@@ -226,13 +226,13 @@ vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt, ...)
if (lm->add_to_elog)
{
- /* *INDENT-OFF* */
- ELOG_TYPE_DECLARE(ee) =
+ ELOG_TYPE_DECLARE(ee) =
{
.format = "log-%s: %s",
.format_args = "t4T4",
- .n_enum_strings = 9,
+ .n_enum_strings = VLIB_LOG_N_LEVELS,
.enum_strings = {
+ "unknown",
"emerg",
"alert",
"crit",
@@ -244,11 +244,11 @@ vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt, ...)
"disabled",
},
};
- struct {
- u32 log_level;
- u32 string_index;
- } *ed;
- /* *INDENT-ON* */
+ struct
+ {
+ u32 log_level;
+ u32 string_index;
+ } * ed;
ed = ELOG_DATA (&vlib_global_main.elog_main, ee);
ed->log_level = level;
ed->string_index =