aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-17 16:59:20 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-17 16:59:20 +0300
commit32dbe5634cc672278f740039becdc330e928e96b (patch)
treeb800b7ebfee48ebc40ed605ba6e2989fe4d255ea
parent0954ea88937b1051c70fdae95b8955323c5d96cf (diff)
downloadrspamd-32dbe5634cc672278f740039becdc330e928e96b.tar.gz
rspamd-32dbe5634cc672278f740039becdc330e928e96b.zip
Fix rspamd_logger.
-rw-r--r--src/lua/lua_common.c8
-rw-r--r--src/plugins/lua/emails.lua12
2 files changed, 10 insertions, 10 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 14bd6877a..bfe60c4da 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -155,7 +155,7 @@ static gint
lua_logger_err (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_CRITICAL, L, msg);
return 1;
}
@@ -164,7 +164,7 @@ static gint
lua_logger_warn (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_WARNING, L, msg);
return 1;
}
@@ -173,7 +173,7 @@ static gint
lua_logger_info (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_INFO, L, msg);
return 1;
}
@@ -182,7 +182,7 @@ static gint
lua_logger_debug (lua_State * L)
{
const gchar *msg;
- msg = luaL_checkstring (L, 2);
+ msg = luaL_checkstring (L, 1);
lua_common_log (G_LOG_LEVEL_DEBUG, L, msg);
return 1;
}
diff --git a/src/plugins/lua/emails.lua b/src/plugins/lua/emails.lua
index 969c762ec..641282c94 100644
--- a/src/plugins/lua/emails.lua
+++ b/src/plugins/lua/emails.lua
@@ -88,7 +88,7 @@ local function add_emails_rule(params)
for _,param in ipairs(params) do
local _,_,name,value = string.find(param, '([a-zA-Z_0-9]+)%s*=%s*(.+)')
if not name or not value then
- rspamd_logger:err('invalid rule: '..param)
+ rspamd_logger.err('invalid rule: '..param)
return nil
end
if name == 'dnsbl' then
@@ -104,13 +104,13 @@ local function add_emails_rule(params)
newrule['domain_only'] = true
end
else
- rspamd_logger:err('invalid rule option: '.. name)
+ rspamd_logger.err('invalid rule option: '.. name)
return nil
end
end
if not newrule['symbol'] or (not newrule['map'] and not newrule['dnsbl']) then
- rspamd_logger:err('incomplete rule')
+ rspamd_logger.err('incomplete rule')
return nil
end
table.insert(rules, newrule)
@@ -123,7 +123,7 @@ if type(rspamd_config.get_api_version) ~= 'nil' then
if rspamd_config:get_api_version() >= 2 then
rspamd_config:register_module_option('emails', 'rule', 'string')
else
- rspamd_logger:err('Invalid rspamd version for this plugin')
+ rspamd_logger.err('Invalid rspamd version for this plugin')
end
end
@@ -136,7 +136,7 @@ if opts then
local params = split(value, ',')
local rule = add_emails_rule (params)
if not rule then
- rspamd_logger:err('cannot add rule: "'..value..'"')
+ rspamd_logger.err('cannot add rule: "'..value..'"')
else
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_virtual_symbol(rule['symbol'], 1.0)
@@ -147,7 +147,7 @@ if opts then
local params = split(strrules, ',')
local rule = add_emails_rule (params)
if not rule then
- rspamd_logger:err('cannot add rule: "'..strrules..'"')
+ rspamd_logger.err('cannot add rule: "'..strrules..'"')
else
if type(rspamd_config.get_api_version) ~= 'nil' then
rspamd_config:register_virtual_symbol(rule['symbol'], 1.0)