Merge branch 'mainstream'
[sliver-openvswitch.git] / lib / vlog.h
index 9050634..2595772 100644 (file)
@@ -71,6 +71,7 @@ struct vlog_module {
     const char *name;             /* User-visible name. */
     int levels[VLF_N_FACILITIES]; /* Minimum log level for each facility. */
     int min_level;                /* Minimum log level for any facility. */
+    bool honor_rate_limits;       /* Set false to ignore rate limits. */
 };
 
 /* Creates and initializes a global instance of a module named MODULE. */
@@ -142,6 +143,11 @@ void vlog_fatal(const struct vlog_module *, const char *format, ...)
 void vlog_fatal_valist(const struct vlog_module *, const char *format, va_list)
     PRINTF_FORMAT (2, 0) NO_RETURN;
 
+void vlog_abort(const struct vlog_module *, const char *format, ...)
+    PRINTF_FORMAT (2, 3) NO_RETURN;
+void vlog_abort_valist(const struct vlog_module *, const char *format, va_list)
+    PRINTF_FORMAT (2, 0) NO_RETURN;
+
 void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
                      struct vlog_rate_limit *, const char *, ...)
     PRINTF_FORMAT (4, 5);
@@ -160,6 +166,7 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
  * Guaranteed to preserve errno.
  */
 #define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, __VA_ARGS__)
+#define VLOG_ABORT(...) vlog_abort(THIS_MODULE, __VA_ARGS__)
 #define VLOG_EMER(...) VLOG(VLL_EMER, __VA_ARGS__)
 #define VLOG_ERR(...) VLOG(VLL_ERR, __VA_ARGS__)
 #define VLOG_WARN(...) VLOG(VLL_WARN, __VA_ARGS__)
@@ -235,9 +242,10 @@ void vlog_usage(void);
         extern struct vlog_module VLM_##MODULE;                         \
         struct vlog_module VLM_##MODULE =                               \
         {                                                               \
-            #MODULE,                                      /* name */    \
+            #MODULE,                                        /* name */  \
             { [ 0 ... VLF_N_FACILITIES - 1] = VLL_INFO }, /* levels */  \
-            VLL_INFO,                                     /* min_level */ \
+            VLL_INFO,                                  /* min_level */  \
+            true                               /* honor_rate_limits */  \
         };
 
 #ifdef  __cplusplus