* autocomplete the next level of subcommands */
help_next_level = (vec_len (str) == 0) || isspace (str[vec_len (str) - 1]);
/* *INDENT-OFF* */
- clib_bitmap_foreach(index, match_bitmap, {
+ clib_bitmap_foreach (index, match_bitmap) {
if (help_next_level && is_unique) {
c = get_sub_command (vcm, c, index);
vec_foreach (sc, c->sub_commands) {
}
sc = &c->sub_commands[index];
vec_add1(result, (u8*) sc->name);
- });
+ }
/* *INDENT-ON* */
done:
vec_free (string);
}
+ else if (unformat (input, "vpplog %v", &string))
+ {
+ int i;
+ /*
+ * Delete leading whitespace, so "vpplog { this and that }"
+ * and "vpplog this" line up nicely.
+ */
+ for (i = 0; i < vec_len (string); i++)
+ if (string[i] != ' ')
+ break;
+ if (i > 0)
+ vec_delete (string, i, 0);
+
+ vlib_log_notice (cm->log, "CLI: %v", string);
+ vec_free (string);
+ }
+
else if (unformat (input, "uncomment %U",
unformat_vlib_cli_sub_input, &sub_input))
{
{
u32 c;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, e);
- ed->c = elog_string (&vm->elog_main, "%v", c->path);
+ ed = ELOG_DATA (vlib_get_elog_main (), e);
+ ed->c = elog_string (vlib_get_elog_main (), "%v", c->path);
}
if (!c->is_mp_safe)
{
u32 c, err;
} *ed;
- ed = ELOG_DATA (&vm->elog_main, e);
- ed->c = elog_string (&vm->elog_main, "%v", c->path);
+ ed = ELOG_DATA (vlib_get_elog_main (), e);
+ ed->c = elog_string (vlib_get_elog_main (), "%v", c->path);
if (c_error)
{
vec_add1 (c_error->what, 0);
- ed->err =
- elog_string (&vm->elog_main, (char *) c_error->what);
+ ed->err = elog_string (vlib_get_elog_main (),
+ (char *) c_error->what);
_vec_len (c_error->what) -= 1;
}
else
- ed->err = elog_string (&vm->elog_main, "OK");
+ ed->err = elog_string (vlib_get_elog_main (), "OK");
}
if (c_error)
*/
if (dispatch || circuit)
{
- elog_main_t *em = &vm->elog_main;
+ elog_main_t *em = &vlib_global_main.elog_main;
em->n_total_events_disable_limit =
em->n_total_events + vec_len (em->event_ring);
return error;
cmd = cmd->next_cli_command;
}
+
+ cm->log = vlib_log_register_class_rate_limit (
+ "cli", "log", 0x7FFFFFFF /* aka no rate limit */);
return error;
}