aboutsummaryrefslogtreecommitdiffstats
path: root/src/rspamadm/rspamadm.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-05-09 13:36:51 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-05-09 13:36:51 +0100
commit54463cbdf7417b26ff9303a74bfdda5a1dde13ad (patch)
tree4e8ee451f3e577535f42e6920a9b205ce0f1256e /src/rspamadm/rspamadm.c
parent58109c5a3f6aaffb5ecc4f9a480fc872b5944884 (diff)
downloadrspamd-54463cbdf7417b26ff9303a74bfdda5a1dde13ad.tar.gz
rspamd-54463cbdf7417b26ff9303a74bfdda5a1dde13ad.zip
[Feature] Add dot commands for lua REPL:
* .help - shows help * .load - loads lua script * .message - scans messages using the specified lua callback
Diffstat (limited to 'src/rspamadm/rspamadm.c')
-rw-r--r--src/rspamadm/rspamadm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rspamadm/rspamadm.c b/src/rspamadm/rspamadm.c
index 61c06c887..b1cda55da 100644
--- a/src/rspamadm/rspamadm.c
+++ b/src/rspamadm/rspamadm.c
@@ -278,6 +278,15 @@ main (gint argc, gchar **argv, gchar **env)
rspamd_main->server_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (),
"rspamadm");
+ cfg->log_level = G_LOG_LEVEL_WARNING;
+
+ cfg->log_type = RSPAMD_LOG_CONSOLE;
+ rspamd_set_logger (cfg, process_quark, rspamd_main);
+ (void) rspamd_log_open (rspamd_main->logger);
+ g_log_set_default_handler (rspamd_glib_log_function, rspamd_main->logger);
+ g_set_printerr_handler (rspamd_glib_printerr_function);
+ rspamd_config_post_load (cfg, FALSE);
+
/* Setup logger */
if (verbose) {
cfg->log_level = G_LOG_LEVEL_DEBUG;
@@ -286,12 +295,6 @@ main (gint argc, gchar **argv, gchar **env)
cfg->log_level = G_LOG_LEVEL_INFO;
}
- cfg->log_type = RSPAMD_LOG_CONSOLE;
- rspamd_set_logger (cfg, process_quark, rspamd_main);
- (void) rspamd_log_open (rspamd_main->logger);
- g_log_set_default_handler (rspamd_glib_log_function, rspamd_main->logger);
- g_set_printerr_handler (rspamd_glib_printerr_function);
-
gperf_profiler_init (cfg, "rspamadm");
setproctitle ("rspamdadm");