From 70b10f8f202ed81bf0a0a90e71faa61b8ed2c2b5 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Fri, 5 Jun 2015 15:09:34 -0700 Subject: [PATCH] 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 --- lib/util/debug.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/util/debug.c b/lib/util/debug.c index 44338c5121f..dce32925e1f 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; -- 2.47.3