diff options
author | Christof Schmitt <cs@samba.org> | 2015-06-05 14:45:22 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-06-11 01:45:21 +0200 |
commit | 50dc46506544b8a4ab2e64732c1998541a69f473 (patch) | |
tree | 83e6c7b7567ca373ac0f6212bc2642888f6fc625 /lib | |
parent | affa21f713df211a9aa2269d55432850a3a20edb (diff) | |
download | samba-50dc46506544b8a4ab2e64732c1998541a69f473.tar.gz |
debug: Add definitions and macros for log levels
This provides some convenience macros to use consistent log levels for
messages with different severities.
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/debug.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/util/debug.h b/lib/util/debug.h index 379572fed81..8d8f43d417f 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -206,6 +206,21 @@ extern int *DEBUGLEVEL_CLASS; #define DEBUGSEP(level)\ DEBUG((level),("===============================================================\n")) +/* + * Debug levels matching RFC 3164 + */ +#define DBGLVL_ERR 0 /* error conditions */ +#define DBGLVL_WARNING 1 /* warning conditions */ +#define DBGLVL_NOTICE 3 /* normal, but significant, condition */ +#define DBGLVL_INFO 5 /* informational message */ +#define DBGLVL_DEBUG 10 /* debug-level message */ + +#define DBG_ERR(...) DEBUG(DBGLVL_ERR, (__VA_ARGS__)) +#define DBG_WARNING(...) DEBUG(DBGLVL_WARNING, (__VA_ARGS__)) +#define DBG_NOTICE(...) DEBUG(DBGLVL_NOTICE, (__VA_ARGS__)) +#define DBG_INFO(...) DEBUG(DBGLVL_INFO, (__VA_ARGS__)) +#define DBG_DEBUG(...) DEBUG(DBGLVL_DEBUG, (__VA_ARGS__)) + /* The following definitions come from lib/debug.c */ /** Possible destinations for the debug log (in order of precedence - |