FD.io VPP  v18.07-34-g55fbdb9
Vector Packet Processing
log.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <stdbool.h>
17 #include <vlib/vlib.h>
18 #include <vlib/log.h>
19 #include <syslog.h>
20 
21 typedef struct
22 {
28 
29 typedef struct
30 {
32  u8 *name;
33  // level of log messages kept for this subclass
35  // level of log messages sent to syslog for this subclass
37  // flag saying whether this subclass is logged to syslog
43 
44 typedef struct
45 {
47  u8 *name;
50 
51 typedef struct
52 {
55  int size, next, count;
56 
57  /* our own log class */
59 
66 
67 vlib_log_main_t log_main = {
68  .default_log_level = VLIB_LOG_LEVEL_NOTICE,
69  .default_syslog_log_level = VLIB_LOG_LEVEL_WARNING,
70  .unthrottle_time = 3,
71  .size = 512,
72  .default_rate_limit = 50,
73 };
74 
75 static int
77 {
79  int i;
80 
81  i = lm->next - lm->count;
82 
83  if (i < 0)
84  i += lm->size;
85  return i;
86 }
87 
88 static vlib_log_class_data_t *
90 {
92  return vec_elt_at_index (lm->classes, (ci >> 16));
93 }
94 
97 {
99  return vec_elt_at_index (c->subclasses, (ci & 0xffff));
100 }
101 
102 static int
104 {
105  switch (level)
106  {
107 #define LOG_DISABLED LOG_DEBUG
108 #define _(n,uc,lc) \
109  case VLIB_LOG_LEVEL_##uc:\
110  return LOG_##uc;
112 #undef _
113 #undef LOG_DISABLED
114  }
115  return LOG_DEBUG;
116 }
117 
118 u8 *
119 format_vlib_log_class (u8 * s, va_list * args)
120 {
121  vlib_log_class_t ci = va_arg (*args, vlib_log_class_t);
124 
125  if (sc->name)
126  return format (s, "%v/%v", c->name, sc->name);
127  else
128  return format (s, "%v", c->name, 0);
129 }
130 
131 
132 void
133 vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt, ...)
134 {
136  vlib_log_main_t *lm = &log_main;
137  vlib_log_entry_t *e;
139  va_list va;
140  f64 t = vlib_time_now (vm);
141  f64 delta = t - sc->last_event_timestamp;
142  u8 *s = 0;
143  bool use_formatted_log_entry = true;
144 
145  vec_validate (lm->entries, lm->size);
146  /* make sure we are running on the main thread to avoid use in dataplane
147  code, for dataplane logging consider use of event-logger */
148  ASSERT (vlib_get_thread_index () == 0);
149 
150  if (level > sc->level)
151  {
152  use_formatted_log_entry = false;
153  goto syslog;
154  }
155 
156  if ((delta > lm->unthrottle_time) ||
157  (sc->is_throttling == 0 && (delta > 1)))
158  {
159  sc->last_event_timestamp = t;
160  sc->last_sec_count = 0;
161  sc->is_throttling = 0;
162  }
163  else
164  {
165  sc->last_sec_count++;
166  if (sc->last_sec_count > sc->rate_limit)
167  return;
168  else if (sc->last_sec_count == sc->rate_limit)
169  {
170  vec_reset_length (s);
171  s = format (0, "--- message(s) throttled ---");
172  sc->is_throttling = 1;
173  }
174  }
175 
176  if (s == 0)
177  {
178  va_start (va, fmt);
179  s = va_format (s, fmt, &va);
180  va_end (va);
181  }
182 
183  e = vec_elt_at_index (lm->entries, lm->next);
184  vec_free (e->string);
185  e->level = level;
186  e->class = class;
187  e->string = s;
188  e->timestamp = t;
189 
190  lm->next = (lm->next + 1) % lm->size;
191  if (lm->size > lm->count)
192  lm->count++;
193 
194 syslog:
195  if (sc->syslog_level != VLIB_LOG_LEVEL_DISABLED &&
196  level <= sc->syslog_level)
197  {
198  u8 *tmp = format (NULL, "%U", format_vlib_log_class, class);
199  if (use_formatted_log_entry)
200  {
201  syslog (vlib_log_level_to_syslog_priority (level), "%.*s: %.*s",
202  vec_len (tmp), tmp,
203  vec_len (s) - (vec_c_string_is_terminated (s) ? 1 : 0), s);
204  }
205  else
206  {
207  tmp = format (tmp, ": ");
208  va_start (va, fmt);
209  tmp = va_format (tmp, fmt, &va);
210  va_end (va);
211  syslog (vlib_log_level_to_syslog_priority (level), "%.*s",
212  vec_len (tmp) - (vec_c_string_is_terminated (tmp) ? 1 : 0),
213  tmp);
214  }
215  vec_free (tmp);
216  }
217 
218 }
219 
221 vlib_log_register_class (char *class, char *subclass)
222 {
223  vlib_log_main_t *lm = &log_main;
227  vec_foreach (tmp, lm->classes)
228  {
229  if (!memcmp (class, tmp->name, vec_len (tmp->name)))
230  {
231  c = tmp;
232  break;
233  }
234  }
235  if (!c)
236  {
237  vec_add2 (lm->classes, c, 1);
238  c->index = c - lm->classes;
239  c->name = format (0, "%s", class);
240  }
241 
242  vec_add2 (c->subclasses, s, 1);
243  s->index = s - c->subclasses;
244  s->name = subclass ? format (0, "%s", subclass) : 0;
246  s->level = lm->default_log_level;
248  return (c->index << 16) | (s->index);
249 }
250 
251 u8 *
252 format_vlib_log_level (u8 * s, va_list * args)
253 {
254  vlib_log_level_t i = va_arg (*args, vlib_log_level_t);
255  char *t = 0;
256 
257  switch (i)
258  {
259 #define _(v,uc,lc) case VLIB_LOG_LEVEL_##uc: t = #lc; break;
261 #undef _
262  default:
263  return format (s, "unknown");
264  }
265  return format (s, "%s", t);
266 }
267 
268 u32
270 {
271  return log_main.indent;
272 }
273 
274 static clib_error_t *
276 {
277  vlib_log_main_t *lm = &log_main;
278  vec_validate (lm->entries, lm->size);
279  lm->log_class = vlib_log_register_class ("log", 0);
280  u8 *tmp = format (NULL, "%U %-10U %-10U ", format_time_float, 0, (f64) 0,
282  log_main.indent = vec_len (tmp);
283  vec_free (tmp);
284  return 0;
285 }
286 
288 
289 
290 static clib_error_t *
292  unformat_input_t * input, vlib_cli_command_t * cmd)
293 {
294  clib_error_t *error = 0;
295  vlib_log_main_t *lm = &log_main;
296  vlib_log_entry_t *e;
297  int i = last_log_entry ();
298  int count = lm->count;
299 
300  while (count--)
301  {
302  e = vec_elt_at_index (lm->entries, i);
303  vlib_cli_output (vm, "%U %-10U %-10U %v",
307  i = (i + 1) % lm->size;
308  }
309 
310  return error;
311 }
312 
313 /* *INDENT-OFF* */
314 VLIB_CLI_COMMAND (cli_show_log, static) = {
315  .path = "show logging",
316  .short_help = "show logging",
317  .function = show_log,
318 };
319 /* *INDENT-ON* */
320 
321 static clib_error_t *
323  unformat_input_t * input, vlib_cli_command_t * cmd)
324 {
325  clib_error_t *error = 0;
326  vlib_log_main_t *lm = &log_main;
329 
330  vlib_cli_output (vm, "%-20s %u entries", "Buffer Size:", lm->size);
331  vlib_cli_output (vm, "Defaults:\n");
332  vlib_cli_output (vm, "%-20s %U", " Log Level:",
334  vlib_cli_output (vm, "%-20s %U", " Syslog Log Level:",
336  vlib_cli_output (vm, "%-20s %u msgs/sec", " Rate Limit:",
337  lm->default_rate_limit);
338  vlib_cli_output (vm, "\n");
339  vlib_cli_output (vm, "%-22s %-14s %-14s %s",
340  "Class/Subclass", "Level", "Syslog Level", "Rate Limit");
341 
342  vec_foreach (c, lm->classes)
343  {
344  vlib_cli_output (vm, "%s", c->name);
345  vec_foreach (sc, c->subclasses)
346  {
347  vlib_cli_output (vm, " %-20s %-14U %-14U %d",
348  sc->name ? (char *) sc->name : "default",
351  sc->rate_limit);
352  }
353  }
354 
355  return error;
356 }
357 
358 /* *INDENT-OFF* */
359 VLIB_CLI_COMMAND (cli_show_log_config, static) = {
360  .path = "show logging configuration",
361  .short_help = "show logging configuration",
362  .function = show_log_config,
363 };
364 /* *INDENT-ON* */
365 
366 static clib_error_t *
368  unformat_input_t * input, vlib_cli_command_t * cmd)
369 {
370  clib_error_t *error = 0;
371  vlib_log_main_t *lm = &log_main;
372  vlib_log_entry_t *e;
373  int i = last_log_entry ();
374  int count = lm->count;
375 
376  while (count--)
377  {
378  e = vec_elt_at_index (lm->entries, i);
379  vec_free (e->string);
380  i = (i + 1) % lm->size;
381  }
382 
383  lm->count = 0;
384  lm->next = 0;
385  vlib_log_info (lm->log_class, "log cleared");
386  return error;
387 }
388 
389 /* *INDENT-OFF* */
390 VLIB_CLI_COMMAND (cli_clear_log, static) = {
391  .path = "clear logging",
392  .short_help = "clear logging",
393  .function = clear_log,
394 };
395 /* *INDENT-ON* */
396 
397 static uword
398 unformat_vlib_log_level (unformat_input_t * input, va_list * args)
399 {
400  vlib_log_level_t *level = va_arg (*args, vlib_log_level_t *);
401  u8 *level_str = NULL;
402  uword rv = 1;
403  if (unformat (input, "%s", &level_str))
404  {
405 #define _(v, uc, lc) \
406  const char __##uc[] = #lc; \
407  if (!strcmp ((const char *) level_str, __##uc)) \
408  { \
409  *level = VLIB_LOG_LEVEL_##uc; \
410  rv = 1; \
411  goto done; \
412  }
414  rv = 0;
415 #undef _
416  }
417 done:
418  vec_free (level_str);
419  return rv;
420 }
421 
422 static uword
423 unformat_vlib_log_class (unformat_input_t * input, va_list * args)
424 {
425  vlib_log_class_data_t **class = va_arg (*args, vlib_log_class_data_t **);
426  uword rv = 0;
427  u8 *class_str = NULL;
428  vlib_log_main_t *lm = &log_main;
429  if (unformat (input, "%v", &class_str))
430  {
431  vlib_log_class_data_t *cdata;
432  vec_foreach (cdata, lm->classes)
433  {
434  if (vec_is_equal (cdata->name, class_str))
435  {
436  *class = cdata;
437  rv = 1;
438  break;
439  }
440  }
441  }
442  vec_free (class_str);
443  return rv;
444 }
445 
446 static clib_error_t *
448  unformat_input_t * input, vlib_cli_command_t * cmd)
449 {
450  unformat_input_t _line_input, *line_input = &_line_input;
451  clib_error_t *rv = NULL;
452  int rate_limit;
453  bool set_rate_limit = false;
454  bool set_level = false;
455  bool set_syslog_level = false;
456  vlib_log_level_t level;
457  vlib_log_level_t syslog_level;
458 
459  /* Get a line of input. */
460  if (!unformat_user (input, unformat_line_input, line_input))
461  return 0;
462 
463  vlib_log_class_data_t *class = NULL;
464  if (!unformat (line_input, "%U", unformat_vlib_log_class, &class))
465  {
466  return clib_error_return (0, "unknown log class `%U'",
467  format_unformat_error, line_input);
468  }
469  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
470  {
471  if (unformat (line_input, "rate-limit %d", &rate_limit))
472  {
473  set_rate_limit = true;
474  }
475  else
476  if (unformat
477  (line_input, "level %U", unformat_vlib_log_level, &level))
478  {
479  set_level = true;
480  }
481  else
482  if (unformat
483  (line_input, "syslog-level %U", unformat_vlib_log_level,
484  &syslog_level))
485  {
486  set_syslog_level = true;
487  }
488  else
489  {
490  return clib_error_return (0, "unknown input `%U'",
491  format_unformat_error, line_input);
492  }
493  }
494 
495  if (set_level)
496  {
497  vlib_log_subclass_data_t *subclass;
498  vec_foreach (subclass, class->subclasses)
499  {
500  subclass->level = level;
501  }
502  }
503  if (set_syslog_level)
504  {
505  vlib_log_subclass_data_t *subclass;
506  vec_foreach (subclass, class->subclasses)
507  {
508  subclass->syslog_level = syslog_level;
509  }
510  }
511  if (set_rate_limit)
512  {
513  vlib_log_subclass_data_t *subclass;
514  vec_foreach (subclass, class->subclasses)
515  {
516  subclass->rate_limit = rate_limit;
517  }
518  }
519 
520  return rv;
521 }
522 
523 /* *INDENT-OFF* */
524 VLIB_CLI_COMMAND (cli_set_log, static) = {
525  .path = "set logging class",
526  .short_help = "set loggging class <class> [rate-limit <int>] "
527  "[level <level>] [syslog-level <level>]",
528  .function = set_log_class,
529 };
530 /* *INDENT-ON* */
531 
532 static clib_error_t *
534  unformat_input_t * input, vlib_cli_command_t * cmd)
535 {
536  unformat_input_t _line_input, *line_input = &_line_input;
537  clib_error_t *rv = NULL;
538  int unthrottle_time;
539  vlib_log_main_t *lm = &log_main;
540 
541  /* Get a line of input. */
542  if (!unformat_user (input, unformat_line_input, line_input))
543  return 0;
544 
545  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
546  {
547  if (unformat (line_input, "%d", &unthrottle_time))
548  lm->unthrottle_time = unthrottle_time;
549  else
550  return clib_error_return (0, "unknown input `%U'",
551  format_unformat_error, line_input);
552  }
553 
554  return rv;
555 }
556 
557 /* *INDENT-OFF* */
558 VLIB_CLI_COMMAND (cli_set_log_params, static) = {
559  .path = "set logging unthrottle-time",
560  .short_help = "set logging unthrottle-time <int>",
561  .function = set_log_unth_time,
562 };
563 /* *INDENT-ON* */
564 
565 static clib_error_t *
567  unformat_input_t * input, vlib_cli_command_t * cmd)
568 {
569  unformat_input_t _line_input, *line_input = &_line_input;
570  clib_error_t *rv = NULL;
571  int size;
572  vlib_log_main_t *lm = &log_main;
573 
574  /* Get a line of input. */
575  if (!unformat_user (input, unformat_line_input, line_input))
576  return 0;
577 
578  while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
579  {
580  if (unformat (line_input, "%d", &size))
581  {
582  lm->size = size;
583  vec_validate (lm->entries, lm->size);
584  }
585  else
586  return clib_error_return (0, "unknown input `%U'",
587  format_unformat_error, line_input);
588  }
589 
590  return rv;
591 }
592 
593 /* *INDENT-OFF* */
594 VLIB_CLI_COMMAND (cli_set_log_size, static) = {
595  .path = "set logging size",
596  .short_help = "set logging size <int>",
597  .function = set_log_size,
598 };
599 /* *INDENT-ON* */
600 
601 static uword
603 {
604  vlib_log_class_data_t *class = va_arg (*args, vlib_log_class_data_t *);
605  vlib_log_subclass_data_t **subclass =
606  va_arg (*args, vlib_log_subclass_data_t **);
607  uword rv = 0;
608  u8 *subclass_str = NULL;
609  if (unformat (input, "%v", &subclass_str))
610  {
611  vlib_log_subclass_data_t *scdata;
612  vec_foreach (scdata, class->subclasses)
613  {
614  if (vec_is_equal (scdata->name, subclass_str))
615  {
616  rv = 1;
617  *subclass = scdata;
618  break;
619  }
620  }
621  }
622  vec_free (subclass_str);
623  return rv;
624 }
625 
626 static clib_error_t *
628  unformat_input_t * input, vlib_cli_command_t * cmd)
629 {
630  unformat_input_t _line_input, *line_input = &_line_input;
631  /* Get a line of input. */
632  if (!unformat_user (input, unformat_line_input, line_input))
633  return 0;
634 
635  vlib_log_class_data_t *class = NULL;
636  vlib_log_subclass_data_t *subclass = NULL;
637  vlib_log_level_t level;
638  if (unformat (line_input, "%U", unformat_vlib_log_level, &level))
639  {
640  if (unformat (line_input, "%U", unformat_vlib_log_class, &class))
641  {
642  if (unformat
643  (line_input, "%U", unformat_vlib_log_subclass, class,
644  &subclass))
645  {
646  vlib_log (level,
647  (class->index << 16) | (subclass->index), "%U",
648  format_unformat_input, line_input);
649  }
650  else
651  {
652  return clib_error_return (0,
653  "unknown log subclass near beginning of `%U'",
654  format_unformat_error, line_input);
655  }
656  }
657  else
658  {
659  return clib_error_return (0,
660  "unknown log class near beginning of `%U'",
661  format_unformat_error, line_input);
662  }
663  }
664  else
665  {
666  return clib_error_return (0, "unknown log level near beginning of `%U'",
667  format_unformat_error, line_input);
668  }
669  return 0;
670 }
671 
672 /* *INDENT-OFF* */
673 VLIB_CLI_COMMAND (cli_test_log, static) = {
674  .path = "test log",
675  .short_help = "test log <class> <subclass> <level> <message",
676  .function = test_log_class_subclass,
677 };
678 /* *INDENT-ON* */
679 
680 static clib_error_t *
682 {
683  vlib_log_main_t *lm = &log_main;
684 
686  {
687  if (unformat (input, "size %d", &lm->size))
688  vec_validate (lm->entries, lm->size);
689  else if (unformat (input, "unthrottle-time %d", &lm->unthrottle_time))
690  ;
691  else if (unformat (input, "default-log-level %U",
693  ;
694  else if (unformat (input, "default-syslog-log-level %U",
697  ;
698  else
699  {
700  return unformat_parse_error (input);
701  }
702  }
703 
704  return 0;
705 }
706 
708 
709 /*
710  * fd.io coding-style-patch-verification: ON
711  *
712  * Local Variables:
713  * eval: (c-set-style "gnu")
714  * End:
715  */
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
Definition: log.c:221
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:437
static clib_error_t * show_log_config(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:322
static clib_error_t * show_log(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:291
u32 vlib_log_class_t
Definition: log.h:21
u8 * format_time_float(u8 *s, va_list *args)
Definition: unix-formats.c:836
#define vec_c_string_is_terminated(V)
Test whether a vector is a NULL terminated c-string.
Definition: vec.h:1008
u8 * format_vlib_log_level(u8 *s, va_list *args)
Definition: log.c:252
vlib_log_entry_t * entries
Definition: log.c:53
vlib_log_level_t level
Definition: log.c:34
static vlib_log_class_data_t * get_class_data(vlib_log_class_t ci)
Definition: log.c:89
#define NULL
Definition: clib.h:55
vlib_log_level_t syslog_level
Definition: log.c:36
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:225
static clib_error_t * clear_log(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:367
vlib_log_class_data_t * classes
Definition: log.c:54
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
Definition: vec.h:562
int i
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:983
f64 timestamp
Definition: log.c:25
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:419
u8 * va_format(u8 *s, const char *fmt, va_list *va)
Definition: format.c:387
unsigned char u8
Definition: types.h:56
static uword unformat_vlib_log_subclass(unformat_input_t *input, va_list *args)
Definition: log.c:602
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
double f64
Definition: types.h:142
u32 indent
Definition: log.c:64
static clib_error_t * vlib_log_init(vlib_main_t *vm)
Definition: log.c:275
static clib_error_t * log_config(vlib_main_t *vm, unformat_input_t *input)
Definition: log.c:681
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:156
u8 * format_white_space(u8 *s, va_list *va)
Definition: std-formats.c:113
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define clib_error_return(e, args...)
Definition: error.h:99
unsigned int u32
Definition: types.h:88
int default_log_level
Definition: log.c:61
unformat_function_t unformat_line_input
Definition: format.h:282
vlib_log_class_t log_class
Definition: log.c:58
uword size
static int vlib_log_level_to_syslog_priority(vlib_log_level_t level)
Definition: log.c:103
static clib_error_t * set_log_class(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:447
struct _unformat_input_t unformat_input_t
int default_syslog_log_level
Definition: log.c:62
int size
Definition: log.c:55
static clib_error_t * set_log_unth_time(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:533
vlib_log_main_t log_main
Definition: log.c:67
static clib_error_t * test_log_class_subclass(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:627
int next
Definition: log.c:55
u8 * format_unformat_input(u8 *s, va_list *va)
Definition: unformat.c:143
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
Definition: init.h:195
#define UNFORMAT_END_OF_INPUT
Definition: format.h:144
svmdb_client_t * c
static_always_inline uword vlib_get_thread_index(void)
Definition: threads.h:221
vlib_main_t * vm
Definition: buffer.c:294
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:339
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:133
static vlib_log_subclass_data_t * get_subclass_data(vlib_log_class_t ci)
Definition: log.c:96
vlib_log_subclass_data_t * subclasses
Definition: log.c:48
#define vec_is_equal(v1, v2)
Compare two vectors, not NULL-pointer tolerant.
Definition: vec.h:911
int default_rate_limit
Definition: log.c:60
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
Definition: log.c:21
#define ASSERT(truth)
vlib_log_class_t class
Definition: log.c:24
u32 vlib_log_get_indent()
Definition: log.c:269
int count
Definition: log.c:55
vlib_log_level_t
Definition: log.h:34
static uword unformat_vlib_log_class(unformat_input_t *input, va_list *args)
Definition: log.c:423
static uword unformat_vlib_log_level(unformat_input_t *input, va_list *args)
Definition: log.c:398
size_t count
Definition: vapi.c:46
vlib_log_level_t level
Definition: log.c:23
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23
#define unformat_parse_error(input)
Definition: format.h:268
static int last_log_entry()
Definition: log.c:76
u8 * format_vlib_log_class(u8 *s, va_list *args)
Definition: log.c:119
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static clib_error_t * set_log_size(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: log.c:566
#define vlib_log_info(...)
Definition: log.h:53
u64 uword
Definition: types.h:112
f64 last_event_timestamp
Definition: log.c:38
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
#define vec_foreach(var, vec)
Vector iterator.
u8 * string
Definition: log.c:26
int unthrottle_time
Definition: log.c:63
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:681
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:972
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:170