diff options
-rw-r--r-- | src/libserver/cfg_rcl.c | 5 | ||||
-rw-r--r-- | src/libutil/logger.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index ab3d21702..5869bd6fb 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -1221,6 +1221,11 @@ rspamd_rcl_config_init (void) rspamd_rcl_parse_struct_boolean, G_STRUCT_OFFSET (struct rspamd_config, log_color), 0); + rspamd_rcl_add_default_handler (sub, + "color", + rspamd_rcl_parse_struct_boolean, + G_STRUCT_OFFSET (struct rspamd_config, log_color), + 0); /** * Options section */ diff --git a/src/libutil/logger.c b/src/libutil/logger.c index b948deaf1..3728b2fb4 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -697,15 +697,15 @@ file_log_function (const gchar * log_domain, cptype = g_quark_to_string (rspamd_log->process_type); if (rspamd_log->cfg->log_color) { - if (log_level >= G_LOG_LEVEL_INFO) { + if (log_level == G_LOG_LEVEL_INFO) { /* White */ - r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[1;37m"); + r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[0;37m"); } - else if (log_level >= G_LOG_LEVEL_WARNING) { + else if (log_level == G_LOG_LEVEL_WARNING) { /* Magenta */ - r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[2;32m"); + r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[0;32m"); } - else if (log_level >= G_LOG_LEVEL_CRITICAL) { + else if (log_level == G_LOG_LEVEL_CRITICAL) { /* Red */ r = rspamd_snprintf (tmpbuf, sizeof (tmpbuf), "\033[1;31m"); } |