debug: Change syslog priority mapping to match new log level macros
authorChristof Schmitt <cs@samba.org>
Fri, 5 Jun 2015 22:09:34 +0000 (15:09 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 10 Jun 2015 23:45:22 +0000 (01:45 +0200)
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 <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/debug.c

index 44338c5121ff51ab3ac2d80fb709ef7283000f31..dce32925e1f73b40cbe264ee51d4154d629f9d00 100644 (file)
@@ -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;