From acbdc30f90ab0cb68f227ca377b6543ef05e21f7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 24 May 2016 19:46:33 +0200 Subject: [PATCH] logging: print debug messages with syslog level LOG_DEBUG --- src/nm-logging.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nm-logging.c b/src/nm-logging.c index d0368d000..4d9b3fbd4 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -93,7 +93,16 @@ typedef struct { typedef struct { const char *name; const char *level_str; + + /* nm-logging uses syslog internally. Note that the three most-verbose syslog levels + * are LOG_DEBUG, LOG_INFO and LOG_NOTICE. Journal already highlights LOG_NOTICE + * as special. + * + * On the other hand, we have three levels LOGL_TRACE, LOGL_DEBUG and LOGL_INFO, + * which are regular messages not to be highlighted. For that reason, we must map + * LOGL_TRACE and LOGL_DEBUG both to syslog level LOG_DEBUG. */ int syslog_level; + GLogLevelFlags g_log_level; LogFormatFlags log_format_level; } LogLevelDesc; @@ -128,7 +137,7 @@ static struct { .log_format_flags = _LOG_FORMAT_FLAG_DEFAULT, .level_desc = { [LOGL_TRACE] = { "TRACE", "", LOG_DEBUG, G_LOG_LEVEL_DEBUG, _LOG_FORMAT_FLAG_LEVEL_DEBUG }, - [LOGL_DEBUG] = { "DEBUG", "", LOG_INFO, G_LOG_LEVEL_DEBUG, _LOG_FORMAT_FLAG_LEVEL_DEBUG }, + [LOGL_DEBUG] = { "DEBUG", "", LOG_DEBUG, G_LOG_LEVEL_DEBUG, _LOG_FORMAT_FLAG_LEVEL_DEBUG }, [LOGL_INFO] = { "INFO", "", LOG_INFO, G_LOG_LEVEL_INFO, _LOG_FORMAT_FLAG_LEVEL_INFO }, [LOGL_WARN] = { "WARN", "", LOG_WARNING, G_LOG_LEVEL_MESSAGE, _LOG_FORMAT_FLAG_LEVEL_INFO }, [LOGL_ERR] = { "ERR", "", LOG_ERR, G_LOG_LEVEL_MESSAGE, _LOG_FORMAT_FLAG_LEVEL_ERROR },