summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-16 18:40:56 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-16 18:40:56 +0400
commit698a6c0e767605924386382fff0488c5de1cd3d7 (patch)
treeb13daf3fa21bb6ae6d79b4b3c7fe33e14f7bb3e6 /src/main.c
parent561d5f4c2424f2ff4b1066d1efb308ddcc8aa06b (diff)
downloadrspamd-698a6c0e767605924386382fff0488c5de1cd3d7.tar.gz
rspamd-698a6c0e767605924386382fff0488c5de1cd3d7.zip
* Make improvements to HTML entites decoder: now it replaces entities with common characters and
remove unknown entities. This behaviour is more like of standart HTML to text conversion * Add -d option to force debug output
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index da8b87e64..3c292f2b4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,6 +74,7 @@ static gchar *rspamd_group;
static gchar *rspamd_pidfile;
static gboolean dump_vars;
static gboolean dump_cache;
+static gboolean is_debug;
/* List of workers that are pending to start */
static GList *workers_pending = NULL;
@@ -92,6 +93,7 @@ static GOptionEntry entries[] =
{ "pid", 'p', 0, G_OPTION_ARG_STRING, &rspamd_pidfile, "Path to pidfile", NULL },
{ "dump-vars", 'V', 0, G_OPTION_ARG_NONE, &dump_vars, "Print all rspamd variables and exit", NULL },
{ "dump-cache", 'C', 0, G_OPTION_ARG_NONE, &dump_cache, "Dump symbols cache stats and exit", NULL },
+ { "debug", 'd', 0, G_OPTION_ARG_NONE, &is_debug, "Force debug output", NULL },
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
@@ -271,6 +273,10 @@ reread_config (struct rspamd_main *rspamd)
close_log ();
g_free (rspamd->cfg);
rspamd->cfg = tmp_cfg;
+ /* Force debug log */
+ if (is_debug) {
+ rspamd->cfg->log_level = G_LOG_LEVEL_DEBUG;
+ }
config_logger (rspamd, FALSE);
/* Perform modules configuring */
l = g_list_first (rspamd->cfg->filters);
@@ -780,7 +786,7 @@ main (int argc, char **argv, char **env)
rspamd->cfg->cfg_name = FIXED_CONFIG_FILE;
}
- if (rspamd->cfg->config_test) {
+ if (rspamd->cfg->config_test || is_debug) {
rspamd->cfg->log_level = G_LOG_LEVEL_DEBUG;
}
else {
@@ -811,6 +817,10 @@ main (int argc, char **argv, char **env)
exit (EXIT_FAILURE);
}
+ /* Force debug log */
+ if (is_debug) {
+ rspamd->cfg->log_level = G_LOG_LEVEL_DEBUG;
+ }
/* Pre-init of cache */
rspamd->cfg->cache = g_new0 (struct symbols_cache, 1);
rspamd->cfg->cache->static_pool = memory_pool_new (memory_pool_get_size ());