diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-04 13:07:07 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-04 13:07:33 +0000 |
commit | b80ddf78c8508210aa1f00dc1654593a2f810c24 (patch) | |
tree | bb879a6b2de7d8538fbfd96a4354992b027a85cd /src/libserver | |
parent | fadd570a71a8b86e8d9be5ff9dbe53f2ead4ac9f (diff) | |
download | rspamd-b80ddf78c8508210aa1f00dc1654593a2f810c24.tar.gz rspamd-b80ddf78c8508210aa1f00dc1654593a2f810c24.zip |
[Minor] Respect forced flag when logging is disabled
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/cfg_file.h | 4 | ||||
-rw-r--r-- | src/libserver/cfg_rcl.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 5b0b87f8b..f6798c9e3 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -658,6 +658,10 @@ gboolean rspamd_config_radix_from_ucl (struct rspamd_config *cfg, cfg->cfg_pool->tag.tagname, cfg->checksum, \ G_STRFUNC, \ __VA_ARGS__) +#define msg_err_config_forced(...) rspamd_default_log_function (G_LOG_LEVEL_CRITICAL|RSPAMD_LOG_FORCED, \ + cfg->cfg_pool->tag.tagname, cfg->checksum, \ + G_STRFUNC, \ + __VA_ARGS__) #define msg_warn_config(...) rspamd_default_log_function (G_LOG_LEVEL_WARNING, \ cfg->cfg_pool->tag.tagname, cfg->checksum, \ G_STRFUNC, \ diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 8b4fa0120..f002587fa 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -3521,18 +3521,18 @@ rspamd_config_read (struct rspamd_config *cfg, const gchar *filename, struct ucl_emitter_functions f; if (stat (filename, &st) == -1) { - msg_err_config ("cannot stat %s: %s", filename, strerror (errno)); + msg_err_config_forced ("cannot stat %s: %s", filename, strerror (errno)); return FALSE; } if ((fd = open (filename, O_RDONLY)) == -1) { - msg_err_config ("cannot open %s: %s", filename, strerror (errno)); + msg_err_config_forced ("cannot open %s: %s", filename, strerror (errno)); return FALSE; } /* Now mmap this file to simplify reading process */ if ((data = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) { - msg_err_config ("cannot mmap %s: %s", filename, strerror (errno)); + msg_err_config_forced ("cannot mmap %s: %s", filename, strerror (errno)); close (fd); return FALSE; } @@ -3545,7 +3545,7 @@ rspamd_config_read (struct rspamd_config *cfg, const gchar *filename, rspamd_ucl_add_conf_macros (parser, cfg); if (!ucl_parser_add_chunk (parser, data, st.st_size)) { - msg_err_config ("ucl parser error: %s", ucl_parser_get_error (parser)); + msg_err_config_forced ("ucl parser error: %s", ucl_parser_get_error (parser)); ucl_parser_free (parser); munmap (data, st.st_size); return FALSE; |