From: Christof Schmitt Date: Fri, 5 Jun 2015 22:09:34 +0000 (-0700) Subject: debug: Change syslog priority mapping to match new log level macros X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=70b10f8f202ed81bf0a0a90e71faa61b8ed2c2b5;p=metze%2Fsamba%2Fwip.git debug: Change syslog priority mapping to match new log level macros This changes the mapping of internal log levels to syslog priorities to match the previously defined helper macros. The idea is that this better maps to the actual use of log levels in the Samba code. unchanged log level | priority 0 | ERROR 1 | WARNING 2 | NOTICE before log level | priority 3 | INFO 4 and higher | DEBUG after log level | priority 3 to 5 | NOTICE 6 to 9 | INFO 10 and higher | DEBUG Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/lib/util/debug.c b/lib/util/debug.c index 44338c5121ff..dce32925e1f7 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -106,14 +106,19 @@ static struct { static int debug_level_to_priority(int level) { /* - * map debug levels to syslog() priorities note that not all - * DEBUG(0, ...) calls are necessarily errors + * map debug levels to syslog() priorities */ - static const int priority_map[4] = { + static const int priority_map[] = { LOG_ERR, /* 0 */ LOG_WARNING, /* 1 */ LOG_NOTICE, /* 2 */ - LOG_INFO, /* 3 */ + LOG_NOTICE, /* 3 */ + LOG_NOTICE, /* 4 */ + LOG_NOTICE, /* 5 */ + LOG_INFO, /* 6 */ + LOG_INFO, /* 7 */ + LOG_INFO, /* 8 */ + LOG_INFO, /* 9 */ }; int priority;