FD.io VPP  v21.06
Vector Packet Processing
log.h File Reference
+ Include dependency graph for log.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vlib_log_entry_t
 
struct  vlib_log_subclass_data_t
 
struct  vlib_log_class_data_t
 
struct  vlib_log_class_config_t
 
struct  vlib_log_registration
 
struct  vlib_log_main_t
 

Macros

#define foreach_vlib_log_level
 
#define vlib_log_emerg(...)   vlib_log(VLIB_LOG_LEVEL_EMERG, __VA_ARGS__)
 
#define vlib_log_alert(...)   vlib_log(VLIB_LOG_LEVEL_ALERT, __VA_ARGS__)
 
#define vlib_log_crit(...)   vlib_log(VLIB_LOG_LEVEL_CRIT, __VA_ARGS__)
 
#define vlib_log_err(...)   vlib_log(VLIB_LOG_LEVEL_ERR, __VA_ARGS__)
 
#define vlib_log_warn(...)   vlib_log(VLIB_LOG_LEVEL_WARNING, __VA_ARGS__)
 
#define vlib_log_notice(...)   vlib_log(VLIB_LOG_LEVEL_NOTICE, __VA_ARGS__)
 
#define vlib_log_info(...)   vlib_log(VLIB_LOG_LEVEL_INFO, __VA_ARGS__)
 
#define vlib_log_debug(...)   vlib_log(VLIB_LOG_LEVEL_DEBUG, __VA_ARGS__)
 
#define VLIB_REGISTER_LOG_CLASS(x, ...)
 

Typedefs

typedef struct vlib_log_registration vlib_log_class_registration_t
 

Enumerations

enum  vlib_log_level_t { VLIB_LOG_LEVEL_UNKNOWN = 0, VLIB_LOG_N_LEVELS }
 

Functions

vlib_log_class_t vlib_log_register_class (char *vlass, char *subclass)
 
vlib_log_class_t vlib_log_register_class_rate_limit (char *class, char *subclass, u32 rate_limit)
 
void vlib_log (vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
 
int last_log_entry ()
 
u8format_vlib_log_class (u8 *s, va_list *args)
 
u8format_vlib_log_level (u8 *s, va_list *args)
 

Variables

vlib_log_main_t log_main
 

Macro Definition Documentation

◆ foreach_vlib_log_level

#define foreach_vlib_log_level
Value:
_(EMERG, emerg) \
_(ALERT, alert) \
_(CRIT, crit) \
_(ERR, error) \
_(WARNING, warn) \
_(NOTICE, notice) \
_(INFO, info) \
_(DEBUG, debug) \
_(DISABLED, disabled)
Definition: cJSON.c:88
#define INFO(...)
Definition: main.c:64
#define DEBUG
Definition: dlmalloc.c:33

Definition at line 22 of file log.h.

◆ vlib_log_alert

#define vlib_log_alert (   ...)    vlib_log(VLIB_LOG_LEVEL_ALERT, __VA_ARGS__)

Definition at line 131 of file log.h.

◆ vlib_log_crit

#define vlib_log_crit (   ...)    vlib_log(VLIB_LOG_LEVEL_CRIT, __VA_ARGS__)

Definition at line 132 of file log.h.

◆ vlib_log_debug

#define vlib_log_debug (   ...)    vlib_log(VLIB_LOG_LEVEL_DEBUG, __VA_ARGS__)

Definition at line 137 of file log.h.

◆ vlib_log_emerg

#define vlib_log_emerg (   ...)    vlib_log(VLIB_LOG_LEVEL_EMERG, __VA_ARGS__)

Definition at line 130 of file log.h.

◆ vlib_log_err

#define vlib_log_err (   ...)    vlib_log(VLIB_LOG_LEVEL_ERR, __VA_ARGS__)

Definition at line 133 of file log.h.

◆ vlib_log_info

#define vlib_log_info (   ...)    vlib_log(VLIB_LOG_LEVEL_INFO, __VA_ARGS__)

Definition at line 136 of file log.h.

◆ vlib_log_notice

#define vlib_log_notice (   ...)    vlib_log(VLIB_LOG_LEVEL_NOTICE, __VA_ARGS__)

Definition at line 135 of file log.h.

◆ vlib_log_warn

#define vlib_log_warn (   ...)    vlib_log(VLIB_LOG_LEVEL_WARNING, __VA_ARGS__)

Definition at line 134 of file log.h.

◆ VLIB_REGISTER_LOG_CLASS

#define VLIB_REGISTER_LOG_CLASS (   x,
  ... 
)
Value:
static void __clib_constructor \
__vlib_add_log_registration_##x (void) \
{ \
vlib_log_main_t * lm = &log_main; \
x.next = lm->registrations; \
x.class = ~0; \
lm->registrations = &x; \
} \
int next
Definition: log.h:97
vlib_log_main_t log_main
Definition: log.c:23

Definition at line 139 of file log.h.

Typedef Documentation

◆ vlib_log_class_registration_t

Enumeration Type Documentation

◆ vlib_log_level_t

Enumerator
VLIB_LOG_LEVEL_UNKNOWN 
VLIB_LOG_N_LEVELS 

Definition at line 33 of file log.h.

Function Documentation

◆ format_vlib_log_class()

u8* format_vlib_log_class ( u8 s,
va_list *  args 
)

Definition at line 89 of file log.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_vlib_log_level()

u8* format_vlib_log_level ( u8 s,
va_list *  args 
)

Definition at line 353 of file log.c.

+ Here is the caller graph for this function:

◆ last_log_entry()

int last_log_entry ( )

Definition at line 62 of file log.c.

+ Here is the caller graph for this function:

◆ vlib_log()

void vlib_log ( vlib_log_level_t  level,
vlib_log_class_t  class,
char *  fmt,
  ... 
)

Definition at line 131 of file log.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_log_register_class()

vlib_log_class_t vlib_log_register_class ( char *  vlass,
char *  subclass 
)

Definition at line 339 of file log.c.

+ Here is the call graph for this function:

◆ vlib_log_register_class_rate_limit()

vlib_log_class_t vlib_log_register_class_rate_limit ( char *  class,
char *  subclass,
u32  rate_limit 
)

Definition at line 346 of file log.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ log_main

vlib_log_main_t log_main

Definition at line 23 of file log.c.