]> source.dussan.org Git - rspamd.git/commitdiff
Fix rspamd_logger.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 17 Feb 2011 13:59:20 +0000 (16:59 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 17 Feb 2011 13:59:20 +0000 (16:59 +0300)
src/lua/lua_common.c
src/plugins/lua/emails.lua

index 14bd6877a1e7f2ce0216da230e8f639e5b2fd6ed..bfe60c4da2d0dcc8d5483d63948b3803859ff293 100644 (file)
@@ -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;
 }
index 969c762ec7c68b498c130471c9ebb67a39a8c41d..641282c9437f2b16545c390279d68ebf9b019f01 100644 (file)
@@ -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)