Mercurial > hg > freeDiameter
diff include/freeDiameter/libfdproto.h @ 1407:d4a4ab5239c7
add log level FD_LOG_INFO
Add log level FD_LOG_INFO, below FD_LOG_NOTICE and above FD_LOG_DEBUG.
author | Luke Mewburn <luke@mewburn.net> |
---|---|
date | Tue, 18 Feb 2020 17:01:07 +1100 |
parents | 357e9cec520f |
children | f6f12521c2aa |
line wrap: on
line diff
--- a/include/freeDiameter/libfdproto.h Tue Feb 18 16:48:26 2020 +1100 +++ b/include/freeDiameter/libfdproto.h Tue Feb 18 17:01:07 2020 +1100 @@ -270,6 +270,7 @@ /* log levels definitions, that are passed to the logger */ #define FD_LOG_ANNOYING 0 /* very verbose loops and such "overkill" traces. Only active when the framework is compiled in DEBUG mode. */ #define FD_LOG_DEBUG 1 /* Get a detailed sense of what is going on in the framework. Use this level for normal debug */ +#define FD_LOG_INFO 2 /* Informational execution states */ #define FD_LOG_NOTICE 3 /* Normal execution states worth noting */ #define FD_LOG_ERROR 5 /* Recoverable or expected error conditions */ #define FD_LOG_FATAL 6 /* Unrecoverable error, e.g. malloc fail, etc. that requires the framework to shutdown */ @@ -330,6 +331,10 @@ #define LOG_D(format,args... ) \ LOG(FD_LOG_DEBUG, format, ##args) +/* Report an info message */ +#define LOG_I(format,args... ) \ + LOG(FD_LOG_INFO, format,##args) + /* Report a normal message that is useful for normal admin monitoring */ #define LOG_N(format,args... ) \ LOG(FD_LOG_NOTICE, format,##args) @@ -516,7 +521,7 @@ int __l__; \ if ((__l__ = TRACE_BOOL(oldlevel))) { \ if (oldlevel <= NONE) { LOG_E(format,##args); } \ - else if (oldlevel <= INFO) { LOG_N(format,##args); } \ + else if (oldlevel <= INFO) { LOG_I(format,##args); } \ else if (__l__ == 2) { LOG_N(format,##args); } \ else if (oldlevel <= FULL) { LOG_D(format,##args); } \ else { LOG_A(format,##args); } \ @@ -595,12 +600,14 @@ /*============================================================*/ #ifdef STRIP_DEBUG_CODE #undef LOG_D +#undef LOG_I #undef LOG_N #undef LOG_E #undef LOG_F #undef LOG_BUFFER #define LOG_D(format,args... ) /* noop */ +#define LOG_I(format,args...) fd_log(FD_LOG_INFO, format, ## args) #define LOG_N(format,args...) fd_log(FD_LOG_NOTICE, format, ## args) #define LOG_E(format,args...) fd_log(FD_LOG_ERROR, format, ## args) #define LOG_F(format,args...) fd_log(FD_LOG_FATAL, format, ## args)