From: Vsevolod Stakhov Date: Thu, 17 Feb 2011 13:59:20 +0000 (+0300) Subject: Fix rspamd_logger. X-Git-Tag: 0.3.7~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32dbe5634cc672278f740039becdc330e928e96b;p=thirdparty%2Frspamd.git Fix rspamd_logger. --- diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index 14bd6877a1..bfe60c4da2 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 969c762ec7..641282c943 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)