X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvlog.h;h=6fa007b275219a03dabe9bcdaa27ce8645f1dcf6;hb=431d6a6acf6da61ecfeb433cb1fb10e1b39e9773;hp=1a11f598e00935772b2e1960ca422420b7d94151;hpb=e2eed6a7581193da43210a26ad182fb2a697eaf5;p=openvswitch diff --git a/lib/vlog.h b/lib/vlog.h index 1a11f598..6fa007b2 100644 --- a/lib/vlog.h +++ b/lib/vlog.h @@ -28,28 +28,11 @@ extern "C" { #endif -/* Logging importance levels. +/* Logging severity levels. * - * The following log levels, in descending order of importance, are enabled by - * default: - * - * - EMER: Not currently used. - * - * - ERR: A high-level operation or a subsystem failed. Attention is - * warranted. - * - * - WARN: A low-level operation failed, but higher-level subsystems may be - * able to recover. - * - * - INFO: Information that may be useful in retrospect when investigating - * a problem. - * - * The lowest log level is not enabled by default: - * - * - DBG: Information useful only to someone with intricate knowledge of the - * system, or that would commonly cause too-voluminous log output. - */ + * ovs-appctl(8) defines each of the log levels. */ #define VLOG_LEVELS \ + VLOG_LEVEL(OFF, LOG_ALERT) \ VLOG_LEVEL(EMER, LOG_ALERT) \ VLOG_LEVEL(ERR, LOG_ERR) \ VLOG_LEVEL(WARN, LOG_WARNING) \ @@ -163,12 +146,10 @@ void vlog_valist(const struct vlog_module *, enum vlog_level, const char *, va_list) PRINTF_FORMAT (3, 0); -void vlog_fatal(const struct vlog_module *, enum vlog_level, - const char *format, ...) - PRINTF_FORMAT (3, 4) NO_RETURN; -void vlog_fatal_valist(const struct vlog_module *, enum vlog_level, - const char *, va_list) - PRINTF_FORMAT (3, 0) NO_RETURN; +void vlog_fatal(const struct vlog_module *, const char *format, ...) + PRINTF_FORMAT (2, 3) NO_RETURN; +void vlog_fatal_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 *, ...) @@ -187,7 +168,7 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level, * * Guaranteed to preserve errno. */ -#define VLOG_FATAL(...) vlog_fatal(THIS_MODULE, VLL_ERR, __VA_ARGS__) +#define VLOG_FATAL(...) vlog_fatal(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__) @@ -197,8 +178,7 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level, /* More convenience macros, for testing whether a given level is enabled in * THIS_MODULE. When constructing a log message is expensive, this enables it * to be skipped. */ -#define VLOG_IS_EMER_ENABLED() true -#define VLOG_IS_ERR_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_EMER) +#define VLOG_IS_ERR_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_ERR) #define VLOG_IS_WARN_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_WARN) #define VLOG_IS_INFO_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_INFO) #define VLOG_IS_DBG_ENABLED() vlog_is_enabled(THIS_MODULE, VLL_DBG)