1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

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 <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Christof Schmitt 2015-06-05 15:09:34 -07:00 committed by Jeremy Allison
parent 50dc465065
commit 70b10f8f20

View 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;