diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-20 14:10:08 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-01-20 14:10:08 +0000 |
commit | e9b802f8c73dff121421128c94076475e0df3bda (patch) | |
tree | f9a274ef11cbc873e06d520c720cb450a1f4766c /src | |
parent | b9f51206b4568a2cf4243bfdc5d192c1804d0b8e (diff) | |
download | rspamd-e9b802f8c73dff121421128c94076475e0df3bda.tar.gz rspamd-e9b802f8c73dff121421128c94076475e0df3bda.zip |
[Project] Convert all C modules to fast debug infrastructure
Diffstat (limited to 'src')
-rw-r--r-- | src/controller.c | 11 | ||||
-rw-r--r-- | src/fuzzy_storage.c | 8 | ||||
-rw-r--r-- | src/libmime/mime_parser.c | 6 | ||||
-rw-r--r-- | src/libserver/cfg_file.h | 6 | ||||
-rw-r--r-- | src/libserver/cfg_utils.c | 6 | ||||
-rw-r--r-- | src/libserver/composites.c | 7 | ||||
-rw-r--r-- | src/libserver/dkim.c | 6 | ||||
-rw-r--r-- | src/libserver/events.c | 6 | ||||
-rw-r--r-- | src/libserver/fuzzy_backend_sqlite.c | 6 | ||||
-rw-r--r-- | src/libserver/html.c | 6 | ||||
-rw-r--r-- | src/libserver/milter.c | 6 | ||||
-rw-r--r-- | src/libserver/monitored.c | 6 | ||||
-rw-r--r-- | src/libserver/re_cache.c | 11 | ||||
-rw-r--r-- | src/libserver/redis_pool.c | 6 | ||||
-rw-r--r-- | src/libserver/spf.c | 5 | ||||
-rw-r--r-- | src/libserver/symbols_cache.c | 6 | ||||
-rw-r--r-- | src/libserver/worker_util.h | 4 | ||||
-rw-r--r-- | src/libstat/classifiers/bayes.c | 5 | ||||
-rw-r--r-- | src/libutil/rrd.c | 5 | ||||
-rw-r--r-- | src/lua/lua_tcp.c | 6 | ||||
-rw-r--r-- | src/lua/lua_xmlrpc.c | 6 | ||||
-rw-r--r-- | src/plugins/chartable.c | 7 | ||||
-rw-r--r-- | src/plugins/surbl.c | 6 | ||||
-rw-r--r-- | src/rspamd.c | 4 | ||||
-rw-r--r-- | src/rspamd_proxy.c | 7 | ||||
-rw-r--r-- | src/worker.c | 4 |
26 files changed, 96 insertions, 66 deletions
diff --git a/src/controller.c b/src/controller.c index b1eb5a352..8de9cde8e 100644 --- a/src/controller.c +++ b/src/controller.c @@ -74,10 +74,6 @@ session->pool->tag.tagname, session->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_session(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - session->pool->tag.tagname, session->pool->tag.uid, \ - G_STRFUNC, \ - __VA_ARGS__) #define msg_err_ctx(...) rspamd_default_log_function(G_LOG_LEVEL_CRITICAL, \ "controller", ctx->cfg->cfg_pool->tag.uid, \ G_STRFUNC, \ @@ -90,11 +86,14 @@ "controller", ctx->cfg->cfg_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_ctx(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "controller", ctx->cfg->cfg_pool->tag.uid, \ + +#define msg_debug_session(...) rspamd_conditional_debug_fast (NULL, session->from_addr, \ + rspamd_controller_log_id, "controller", session->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(controller) + /* Graph colors */ #define COLOR_CLEAN "#58A458" #define COLOR_PROBABLE_SPAM "#D67E7E" diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 07d32fd30..d1e471542 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -58,10 +58,6 @@ static const gchar *local_db_name = "local"; session->name, session->uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_fuzzy_update(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - session->name, session->uid, \ - G_STRFUNC, \ - __VA_ARGS__) #define msg_err_fuzzy_collection(...) rspamd_default_log_function (G_LOG_LEVEL_CRITICAL, \ "fuzzy_collection", session->uid, \ G_STRFUNC, \ @@ -74,10 +70,6 @@ static const gchar *local_db_name = "local"; "fuzzy_collection", session->uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_fuzzy_collection(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "fuzzy_collection", session->uid, \ - G_STRFUNC, \ - __VA_ARGS__) /* Init functions */ gpointer init_fuzzy (struct rspamd_config *cfg); diff --git a/src/libmime/mime_parser.c b/src/libmime/mime_parser.c index 36a66cdd6..8bcee0c95 100644 --- a/src/libmime/mime_parser.c +++ b/src/libmime/mime_parser.c @@ -31,11 +31,13 @@ struct rspamd_mime_parser_lib_ctx { static const guint max_nested = 32; static const guint max_key_usages = 10000; -#define msg_debug_mime(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "mime", task->task_pool->tag.uid, \ +#define msg_debug_mime(...) rspamd_conditional_debug_fast (NULL, task->from_addr, \ + rspamd_mime_log_id, "mime", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(mime) + #define RSPAMD_MIME_BOUNDARY_FLAG_CLOSED (1 << 0) #define RSPAMD_BOUNDARY_IS_CLOSED(b) ((b)->flags & RSPAMD_MIME_BOUNDARY_FLAG_CLOSED) diff --git a/src/libserver/cfg_file.h b/src/libserver/cfg_file.h index 5f04a39a7..cb433b6d5 100644 --- a/src/libserver/cfg_file.h +++ b/src/libserver/cfg_file.h @@ -663,9 +663,11 @@ gboolean rspamd_config_radix_from_ucl (struct rspamd_config *cfg, cfg->cfg_pool->tag.tagname, cfg->checksum, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_config(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - cfg->cfg_pool->tag.tagname, cfg->checksum, \ +extern guint rspamd_config_log_id; +#define msg_debug_config(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_config_log_id, "config", cfg->checksum, \ G_STRFUNC, \ __VA_ARGS__) + #endif /* ifdef CFG_FILE_H */ diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index a0acb53b9..e14495ded 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -56,6 +56,12 @@ static gchar * rspamd_ucl_read_cb (gchar * chunk, gboolean final); static void rspamd_ucl_fin_cb (struct map_cb_data *data); +guint rspamd_config_log_id = (guint)-1; +RSPAMD_CONSTRUCTOR(rspamd_config_log_init) +{ + rspamd_config_log_id = rspamd_logger_add_debug_module("config"); +} + gboolean rspamd_parse_bind_line (struct rspamd_config *cfg, struct rspamd_worker_conf *cf, diff --git a/src/libserver/composites.c b/src/libserver/composites.c index e824ef8d4..6b6776f47 100644 --- a/src/libserver/composites.c +++ b/src/libserver/composites.c @@ -33,11 +33,14 @@ "composites", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_composites(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "composites", task->task_pool->tag.uid, \ + +#define msg_debug_composites(...) rspamd_conditional_debug_fast (NULL, task->from_addr, \ + rspamd_composites_log_id, "composites", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(composites) + struct composites_data { struct rspamd_task *task; struct rspamd_composite *composite; diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index d3aa7c0bc..dcf440355 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -86,11 +86,13 @@ enum rspamd_dkim_key_type { "dkim", ctx->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_dkim(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "dkim", ctx->pool->tag.uid, \ +#define msg_debug_dkim(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_dkim_log_id, "dkim", ctx->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(dkim) + struct rspamd_dkim_common_ctx { rspamd_mempool_t *pool; guint64 sig_hash; diff --git a/src/libserver/events.c b/src/libserver/events.c index 4a7d5d634..baf108e38 100644 --- a/src/libserver/events.c +++ b/src/libserver/events.c @@ -37,11 +37,13 @@ "events", session->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_session(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "events", session->pool->tag.uid, \ +#define msg_debug_session(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_events_log_id, "events", session->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(events) + struct rspamd_watch_stack { event_watcher_t cb; gpointer ud; diff --git a/src/libserver/fuzzy_backend_sqlite.c b/src/libserver/fuzzy_backend_sqlite.c index 6efa103a4..90c0db70d 100644 --- a/src/libserver/fuzzy_backend_sqlite.c +++ b/src/libserver/fuzzy_backend_sqlite.c @@ -46,11 +46,13 @@ static const guint max_retries = 10; backend->pool->tag.tagname, backend->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_fuzzy_backend(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - backend->pool->tag.tagname, backend->pool->tag.uid, \ +#define msg_debug_fuzzy_backend(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_fuzzy_sqlite_log_id, backend->pool->tag.tagname, backend->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(fuzzy_sqlite) + static const char *create_tables_sql = "BEGIN;" "CREATE TABLE IF NOT EXISTS digests(" diff --git a/src/libserver/html.c b/src/libserver/html.c index 26318db43..c21871a93 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -37,11 +37,13 @@ struct html_tag_def { guint flags; }; -#define msg_debug_html(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "html", pool->tag.uid, \ +#define msg_debug_html(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_html_log_id, "html", pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(html) + #define TAG_DEF(id, name, flags) {(name), (id), (sizeof(name) - 1), (flags)} static struct html_tag_def tag_defs[] = { diff --git a/src/libserver/milter.c b/src/libserver/milter.c index 1b3e4de7e..511655e92 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -41,11 +41,13 @@ "milter", priv->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_milter(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "milter", priv->pool->tag.uid, \ +#define msg_debug_milter(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_milter_log_id, "milter", priv->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(milter) + struct rspamd_milter_context { gchar *spam_header; void *sessions_cache; diff --git a/src/libserver/monitored.c b/src/libserver/monitored.c index 96e161e1a..bd350e16d 100644 --- a/src/libserver/monitored.c +++ b/src/libserver/monitored.c @@ -78,11 +78,13 @@ struct rspamd_monitored { "monitored", m->tag, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_mon(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "monitored", m->tag, \ +#define msg_debug_mon(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_monitored_log_id, "monitored", m->tag, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(monitored) + static inline void rspamd_monitored_propagate_error (struct rspamd_monitored *m, const gchar *error) diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c index d0e17603d..e92421658 100644 --- a/src/libserver/re_cache.c +++ b/src/libserver/re_cache.c @@ -52,15 +52,18 @@ "re_cache", cache->hash, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_re_cache(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "re_cache", cache->hash, \ + +#define msg_debug_re_task(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_re_cache_log_id, "re_cache", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_re_task(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "re_cache", task->task_pool->tag.uid, \ +#define msg_debug_re_cache(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_re_cache_log_id, "re_cache", cache->hash, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(re_cache) + #ifdef WITH_HYPERSCAN #define RSPAMD_HS_MAGIC_LEN (sizeof (rspamd_hs_magic)) static const guchar rspamd_hs_magic[] = {'r', 's', 'h', 's', 'r', 'e', '1', '1'}, diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c index bbc734173..3d77aca1c 100644 --- a/src/libserver/redis_pool.c +++ b/src/libserver/redis_pool.c @@ -67,11 +67,13 @@ static const guint default_max_conns = 100; "redis_pool", conn->tag, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_rpool(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "redis_pool", conn->tag, \ +#define msg_debug_rpool(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_redis_pool_log_id, "redis_pool", conn->tag, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(redis_pool) + static inline guint64 rspamd_redis_pool_get_key (const gchar *db, const gchar *password, const char *ip, int port) diff --git a/src/libserver/spf.c b/src/libserver/spf.c index b0afe1d66..8a19e3094 100644 --- a/src/libserver/spf.c +++ b/src/libserver/spf.c @@ -98,11 +98,12 @@ struct spf_record { "spf", rec->task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_spf(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "spf", rec->task->task_pool->tag.uid, \ +#define msg_debug_spf(...) rspamd_conditional_debug_fast (NULL, rec->task->from_addr, \ + rspamd_spf_log_id, "spf", rec->task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(spf) struct spf_dns_cb { struct spf_record *rec; diff --git a/src/libserver/symbols_cache.c b/src/libserver/symbols_cache.c index 5307c44b6..b890578ed 100644 --- a/src/libserver/symbols_cache.c +++ b/src/libserver/symbols_cache.c @@ -37,11 +37,13 @@ cache->static_pool->tag.tagname, cache->cfg->checksum, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_cache(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - cache->static_pool->tag.tagname, cache->cfg->checksum, \ +#define msg_debug_cache(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_symcache_log_id, "symcache", cache->cfg->checksum, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(symcache) + static const guchar rspamd_symbols_cache_magic[8] = {'r', 's', 'c', 2, 0, 0, 0, 0 }; static gint rspamd_symbols_cache_find_symbol_parent (struct symbols_cache *cache, diff --git a/src/libserver/worker_util.h b/src/libserver/worker_util.h index 9e99a99a5..14ca3ff2a 100644 --- a/src/libserver/worker_util.h +++ b/src/libserver/worker_util.h @@ -202,9 +202,5 @@ void rspamd_worker_init_monitored (struct rspamd_worker *worker, rspamd_main->server_pool->tag.tagname, rspamd_main->server_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_main(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - rspamd_main->server_pool->tag.tagname, rspamd_main->server_pool->tag.uid, \ - G_STRFUNC, \ - __VA_ARGS__) #endif /* WORKER_UTIL_H_ */ diff --git a/src/libstat/classifiers/bayes.c b/src/libstat/classifiers/bayes.c index af25195b0..5b6b5a0fe 100644 --- a/src/libstat/classifiers/bayes.c +++ b/src/libstat/classifiers/bayes.c @@ -33,11 +33,12 @@ "bayes", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_bayes(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "bayes", task->task_pool->tag.uid, \ +#define msg_debug_bayes(...) rspamd_conditional_debug_fast (NULL, task->from_addr, \ + rspamd_bayes_log_id, "bayes", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(bayes) static inline GQuark bayes_error_quark (void) diff --git a/src/libutil/rrd.c b/src/libutil/rrd.c index 3e67bb2a3..95d78c7f5 100644 --- a/src/libutil/rrd.c +++ b/src/libutil/rrd.c @@ -37,11 +37,12 @@ "rrd", file->id, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_rrd(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "rrd", file->id, \ +#define msg_debug_rrd(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_rrd_log_id, "rrd", file->id, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(rrd) static GQuark rrd_error_quark (void) diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c index cd2dcc6e1..dcaa3bc57 100644 --- a/src/lua/lua_tcp.c +++ b/src/lua/lua_tcp.c @@ -204,11 +204,13 @@ struct lua_tcp_cbdata { ref_entry_t ref; }; -#define msg_debug_tcp(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "lua_tcp", cbd->tag, \ +#define msg_debug_tcp(...) rspamd_conditional_debug_fast (NULL, cbd->addr, \ + rspamd_lua_tcp_log_id, "lua_tcp", cbd->tag, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(lua_tcp) + static void lua_tcp_handler (int fd, short what, gpointer ud); static void lua_tcp_plan_handler_event (struct lua_tcp_cbdata *cbd, gboolean can_read, gboolean can_write); diff --git a/src/lua/lua_xmlrpc.c b/src/lua/lua_xmlrpc.c index 9f8508945..4864dbfef 100644 --- a/src/lua/lua_xmlrpc.c +++ b/src/lua/lua_xmlrpc.c @@ -26,11 +26,13 @@ static const struct luaL_reg xmlrpclib_m[] = { {NULL, NULL} }; -#define msg_debug_xmlrpc(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "xmlrpc", "", \ +#define msg_debug_xmlrpc(...) rspamd_conditional_debug_fast (NULL, NULL, \ + rspamd_xmlrpc_log_id, "xmlrpc", "", \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(xmlrpc) + enum lua_xmlrpc_state { read_method_responce = 0, read_params = 1, diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index c9294cec3..0d409480a 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -47,11 +47,14 @@ "chartable", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_chartable(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "chartable", task->task_pool->tag.uid, \ + +#define msg_debug_chartable(...) rspamd_conditional_debug_fast (NULL, task->from_addr, \ + rspamd_chartable_log_id, "chartable", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(chartable) + /* Initialization */ gint chartable_module_init (struct rspamd_config *cfg, struct module_ctx **ctx); gint chartable_module_config (struct rspamd_config *cfg); diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 7d93c31e3..88992fb07 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -55,11 +55,13 @@ "surbl", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_surbl(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "surbl", task->task_pool->tag.uid, \ +#define msg_debug_surbl(...) rspamd_conditional_debug_fast (NULL, task->from_addr, \ + rspamd_surbl_log_id, "surbl", task->task_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(surbl) + #define SURBL_REDIRECTOR_CALLBACK "SURBL_REDIRECTOR_CALLBACK" static struct surbl_ctx *surbl_module_ctx = NULL; diff --git a/src/rspamd.c b/src/rspamd.c index 6d20fe50c..bd25e51c7 100644 --- a/src/rspamd.c +++ b/src/rspamd.c @@ -302,7 +302,7 @@ reread_config (struct rspamd_main *rspamd_main) REF_RELEASE (tmp_cfg); } else { - msg_debug_main ("replacing config"); + msg_info_main ("replacing config"); REF_RELEASE (old_cfg); msg_info_main ("config has been reread successfully"); } @@ -984,7 +984,7 @@ rspamd_cld_handler (gint signo, short what, gpointer arg) /* Turn off locking for logger */ rspamd_log_nolock (rspamd_main->logger); - msg_debug_main ("catch SIGCHLD signal, finding terminated workers"); + msg_info_main ("catch SIGCHLD signal, finding terminated workers"); /* Remove dead child form children list */ while ((wrk = waitpid (0, &res, WNOHANG)) > 0) { if ((cur = diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c index 2a451ff3e..6dedffff3 100644 --- a/src/rspamd_proxy.c +++ b/src/rspamd_proxy.c @@ -57,11 +57,14 @@ session->pool->tag.tagname, session->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_session(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - session->pool->tag.tagname, session->pool->tag.uid, \ + +#define msg_debug_session(...) rspamd_conditional_debug_fast (NULL, session->client_addr, \ + rspamd_proxy_log_id, "proxy", session->pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) +INIT_LOG_MODULE(proxy) + gpointer init_rspamd_proxy (struct rspamd_config *cfg); void start_rspamd_proxy (struct rspamd_worker *worker); diff --git a/src/worker.c b/src/worker.c index 8b01205eb..fc71be1be 100644 --- a/src/worker.c +++ b/src/worker.c @@ -68,10 +68,6 @@ worker_t normal_worker = { "controller", ctx->cfg->cfg_pool->tag.uid, \ G_STRFUNC, \ __VA_ARGS__) -#define msg_debug_ctx(...) rspamd_default_log_function (G_LOG_LEVEL_DEBUG, \ - "controller", ctx->cfg->cfg_pool->tag.uid, \ - G_STRFUNC, \ - __VA_ARGS__) static gboolean rspamd_worker_finalize (gpointer user_data) |