aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-01 17:34:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-01 17:34:25 +0100
commite662595f7d164e2d1884f099195065f975f64ac8 (patch)
tree9b957bc046cabc696f127bd4443bbd3d9f2fbc61 /src/libserver
parent04dee5ab21432d54df1c3e9d8d878e6c5dd99143 (diff)
downloadrspamd-e662595f7d164e2d1884f099195065f975f64ac8.tar.gz
rspamd-e662595f7d164e2d1884f099195065f975f64ac8.zip
Add debug_modules option.
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/cfg_file.h1
-rw-r--r--src/libserver/cfg_rcl.c5
-rw-r--r--src/libserver/cfg_utils.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h
index 3a1e01bfb..4d87bf8e4 100644
--- a/src/libserver/cfg_file.h
+++ b/src/libserver/cfg_file.h
@@ -199,6 +199,7 @@ struct rspamd_config {
gchar *debug_ip_map; /**< turn on debugging for specified ip addresses */
gboolean log_urls; /**< whether we should log URLs */
GList *debug_symbols; /**< symbols to debug */
+ GHashTable *debug_modules; /**< logging modules to debug */
gboolean log_color; /**< output colors for console output */
gboolean log_extended; /**< log extended information */
diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c
index b6ca6705c..3a98cdd55 100644
--- a/src/libserver/cfg_rcl.c
+++ b/src/libserver/cfg_rcl.c
@@ -1190,6 +1190,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,
+ "debug_modules",
+ rspamd_rcl_parse_struct_string_list,
+ G_STRUCT_OFFSET (struct rspamd_config, debug_modules),
+ RSPAMD_CL_FLAG_STRING_LIST_HASH);
/**
* Options section
*/
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 161ea9501..776d00670 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -165,6 +165,7 @@ rspamd_config_defaults (struct rspamd_config *cfg)
rspamd_str_equal);
cfg->cfg_params = g_hash_table_new (rspamd_str_hash, rspamd_str_equal);
cfg->metrics_symbols = g_hash_table_new (rspamd_str_hash, rspamd_str_equal);
+ cfg->debug_modules = g_hash_table_new (rspamd_str_hash, rspamd_str_equal);
cfg->map_timeout = DEFAULT_MAP_TIMEOUT;
@@ -188,7 +189,8 @@ rspamd_config_free (struct rspamd_config *cfg)
g_hash_table_remove_all (cfg->cfg_params);
g_hash_table_unref (cfg->cfg_params);
g_hash_table_destroy (cfg->metrics_symbols);
- g_hash_table_destroy (cfg->classifiers_symbols);
+ g_hash_table_unref (cfg->classifiers_symbols);
+ g_hash_table_unref (cfg->debug_modules);
if (cfg->checksum) {
g_free (cfg->checksum);