From: Vsevolod Stakhov Date: Thu, 15 Mar 2018 15:16:45 +0000 (+0000) Subject: [Minor] Fix enabling debug modules on startup X-Git-Tag: 1.7.1~40 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a430b091986b3ed700d809667d4280e890e0df04;p=rspamd.git [Minor] Fix enabling debug modules on startup --- diff --git a/src/libutil/logger.c b/src/libutil/logger.c index 629ae8a12..0926b09de 100644 --- a/src/libutil/logger.c +++ b/src/libutil/logger.c @@ -1439,7 +1439,11 @@ rspamd_logger_configure_modules (GHashTable *mods_enabled) while (g_hash_table_iter_next (&it, &k, &v)) { id = rspamd_logger_add_debug_module ((const gchar *)k); - msg_info ("enable debugging for module %s (%d)", (const gchar *)k, id); - setbit (log_modules->bitset, id); + + if (isclr (log_modules->bitset, id)) { + msg_info ("enable debugging for module %s (%d)", (const gchar *) k, + id); + setbit (log_modules->bitset, id); + } } } \ No newline at end of file diff --git a/src/rspamd.c b/src/rspamd.c index 3106ea0a9..a44f33b6c 100644 --- a/src/rspamd.c +++ b/src/rspamd.c @@ -265,6 +265,8 @@ config_logger (rspamd_mempool_t *pool, gpointer ud) fprintf (stderr, "Fatal error, cannot open logfile, exiting\n"); exit (EXIT_FAILURE); } + + rspamd_logger_configure_modules (rspamd_main->cfg->debug_modules); } static void