X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=blobdiff_plain;f=src%2Fvlib%2Flog.c;h=578fc942604dbbb1541392e0c0f67c4981d69cb1;hp=9a0d75fe3ac8e3cd242d3a1b6e5754e6d9fa9bf8;hb=03f1af23b;hpb=1d6d9f021c5a169dedca55b46451ab54728e3ee8 diff --git a/src/vlib/log.c b/src/vlib/log.c index 9a0d75fe3ac..578fc942604 100644 --- a/src/vlib/log.c +++ b/src/vlib/log.c @@ -18,57 +18,6 @@ #include #include -typedef struct -{ - vlib_log_level_t level; - vlib_log_class_t class; - f64 timestamp; - u8 *string; -} vlib_log_entry_t; - -typedef struct -{ - u32 index; - u8 *name; - // level of log messages kept for this subclass - vlib_log_level_t level; - // level of log messages sent to syslog for this subclass - vlib_log_level_t syslog_level; - // flag saying whether this subclass is logged to syslog - f64 last_event_timestamp; - int last_sec_count; - int is_throttling; - int rate_limit; -} vlib_log_subclass_data_t; - -typedef struct -{ - u32 index; - u8 *name; - vlib_log_subclass_data_t *subclasses; -} vlib_log_class_data_t; - -typedef struct -{ - vlib_log_entry_t *entries; - vlib_log_class_data_t *classes; - int size, next, count; - - /* our own log class */ - vlib_log_class_t log_class; - - int default_rate_limit; - int default_log_level; - int default_syslog_log_level; - int unthrottle_time; - u32 indent; - - /* time zero */ - struct timeval time_zero_timeval; - f64 time_zero; - -} vlib_log_main_t; - vlib_log_main_t log_main = { .default_log_level = VLIB_LOG_LEVEL_NOTICE, .default_syslog_log_level = VLIB_LOG_LEVEL_WARNING, @@ -77,7 +26,7 @@ vlib_log_main_t log_main = { .default_rate_limit = 50, }; -static int +int last_log_entry () { vlib_log_main_t *lm = &log_main;