Re: [RFC PATCH v3 1/5] ndctl: nvdimmd: add LOG_NOTICE level to

2018-02-11 Thread Dan Williams
On Sun, Feb 11, 2018 at 12:18 PM, Dan Williams  wrote:
> On Fri, Feb 9, 2018 at 12:02 AM, QI Fuli  wrote:
>> This patch adds LOG_NOTICE level to log_priority for the notifications
>> of nvdimm dimm over threshold event. Currently, the LOG_INFO level
>> is too low, and the notifications are not up to LOG_ERROR level.
>>
>
> Looks good, applied.

Although, this patch has little to do with nvdimmd, so I'm changing
the subject to:

"ndctl, log: add support for LOG_NOTICE messages"
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


Re: [RFC PATCH v3 1/5] ndctl: nvdimmd: add LOG_NOTICE level to

2018-02-11 Thread Dan Williams
On Fri, Feb 9, 2018 at 12:02 AM, QI Fuli  wrote:
> This patch adds LOG_NOTICE level to log_priority for the notifications
> of nvdimm dimm over threshold event. Currently, the LOG_INFO level
> is too low, and the notifications are not up to LOG_ERROR level.
>

Looks good, applied.
___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm


[RFC PATCH v3 1/5] ndctl: nvdimmd: add LOG_NOTICE level to

2018-02-09 Thread QI Fuli
This patch adds LOG_NOTICE level to log_priority for the notifications
of nvdimm dimm over threshold event. Currently, the LOG_INFO level
is too low, and the notifications are not up to LOG_ERROR level.

Signed-off-by: QI Fuli 
---
 util/log.c | 2 ++
 util/log.h | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/util/log.c b/util/log.c
index cc4d7d8..c60ca33 100644
--- a/util/log.c
+++ b/util/log.c
@@ -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;
 }
 
diff --git a/util/log.h b/util/log.h
index 5fc56e8..495e0d3 100644
--- a/util/log.h
+++ b/util/log.h
@@ -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
-- 
2.9.5


___
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm