@@ -50,6 +50,8 @@ static int log_priority(const char *priority)
return LOG_INFO;
if (strncmp(priority, "debug", 5) == 0)
return LOG_DEBUG;
+ if (strncmp(priority, "notice", 6) == 0)
+ return LOG_NOTICE;
return 0;
}
@@ -48,15 +48,18 @@ do { \
# endif
# define log_info(ctx, arg...) log_cond(ctx, LOG_INFO, ## arg)
# define log_err(ctx, arg...) log_cond(ctx, LOG_ERR, ## arg)
+# define log_notice(ctx, arg...) log_cond(ctx, LOG_NOTICE, ## arg)
#else
# define log_dbg(ctx, arg...) log_null(ctx, ## arg)
# define log_info(ctx, arg...) log_null(ctx, ## arg)
# define log_err(ctx, arg...) log_null(ctx, ## arg)
+# define log_notice(ctx, arg...) log_null(ctx, ## arg)
#endif
#define dbg(x, arg...) log_dbg(&(x)->ctx, ## arg)
#define info(x, arg...) log_info(&(x)->ctx, ## arg)
#define err(x, arg...) log_err(&(x)->ctx, ## arg)
+#define notice(x, arg...) log_notice(&(x)->ctx, ## arg)
#ifndef HAVE_SECURE_GETENV
# ifdef HAVE___SECURE_GETENV
This patch adds LOG_NOTICE level into log_priority for the notifications. Because the LOG_INFO level is too low for the notifications of nvdimm dimm over threshold event, and the event notifications are not up to LOG_ERROR level. Signed-off-by: QI Fuli <qi.fuli@jp.fujitsu.com> --- util/log.c | 2 ++ util/log.h | 3 +++ 2 files changed, 5 insertions(+)