diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-12-22 01:32:18 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-12-22 01:32:18 +0300 |
commit | e413f4ee9cd298baab701df31ab4c1cb91c7c4b6 (patch) | |
tree | 46858bef680c8a09b6d1d58a5ca7e3a8cec4e62d /src/lua/lua_common.c | |
parent | a079dac866ac4e166a8d6e40f978af74e8398583 (diff) | |
download | rspamd-e413f4ee9cd298baab701df31ab4c1cb91c7c4b6.tar.gz rspamd-e413f4ee9cd298baab701df31ab4c1cb91c7c4b6.zip |
* Introduce new logging system:
- independent and customizeable buffering
- line buffering
- errors handling support
- custom (ip based) debug
- append function name automaticaly (based on __FUNCTION__)
- add some logic to logs system
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r-- | src/lua/lua_common.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index 1ad61aaf0..1d2f46c3a 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -214,7 +214,7 @@ init_lua_filters (struct config_file *cfg) module = cur->data; if (module->path) { if (luaL_loadfile (L, module->path) != 0) { - msg_info ("lua_init_filters: load of %s failed: %s", module->path, lua_tostring (L, -1)); + msg_info ("load of %s failed: %s", module->path, lua_tostring (L, -1)); cur = g_list_next (cur); continue; } @@ -226,7 +226,7 @@ init_lua_filters (struct config_file *cfg) lua_setglobal (L, "rspamd_config"); /* do the call (1 arguments, 1 result) */ if (lua_pcall (L, 0, LUA_MULTRET, 0) != 0) { - msg_info ("lua_init_filters: init of %s failed: %s", module->path, lua_tostring (L, -1)); + msg_info ("init of %s failed: %s", module->path, lua_tostring (L, -1)); } } cur = g_list_next (cur); @@ -247,12 +247,12 @@ lua_call_filter (const char *function, struct worker_task *task) *ptask = task; if (lua_pcall (L, 1, 1, 0) != 0) { - msg_info ("lua_call_filter: call to %s failed", function); + msg_info ("call to %s failed", function); } /* retrieve result */ if (!lua_isnumber (L, -1)) { - msg_info ("lua_call_filter: function %s must return a number", function); + msg_info ("function %s must return a number", function); } result = lua_tonumber (L, -1); lua_pop (L, 1); /* pop returned value */ @@ -270,12 +270,12 @@ lua_call_chain_filter (const char *function, struct worker_task *task, int *mark lua_pushnumber (L, marks[i]); } if (lua_pcall (L, number, 1, 0) != 0) { - msg_info ("lua_init_filters: call to %s failed", function); + msg_info ("call to %s failed", function); } /* retrieve result */ if (!lua_isnumber (L, -1)) { - msg_info ("lua_call_header_filter: function %s must return a number", function); + msg_info ("function %s must return a number", function); } result = lua_tonumber (L, -1); lua_pop (L, 1); /* pop returned value */ @@ -303,12 +303,12 @@ lua_consolidation_callback (gpointer key, gpointer value, gpointer arg) lua_pushstring (L, (const char *)key); lua_pushnumber (L, s->score); if (lua_pcall (L, 2, 1, 0) != 0) { - msg_info ("lua_consolidation_callback: call to %s failed", data->func); + msg_info ("call to %s failed", data->func); } /* retrieve result */ if (!lua_isnumber (L, -1)) { - msg_info ("lua_consolidation_callback: function %s must return a number", data->func); + msg_info ("function %s must return a number", data->func); } res = lua_tonumber (L, -1); lua_pop (L, 1); /* pop returned value */ |