diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-02 09:12:17 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-02 09:12:17 +0100 |
commit | 61c2a3c1e4ef7291130c8f6ea45d0b72e4b86d22 (patch) | |
tree | 28e52fc3f48b4465833df88b48d0fcdfb497090a /lualib/lua_util.lua | |
parent | 633e5513e27b1ea14b6f152ef72a5498b6b1f825 (diff) | |
download | rspamd-61c2a3c1e4ef7291130c8f6ea45d0b72e4b86d22.tar.gz rspamd-61c2a3c1e4ef7291130c8f6ea45d0b72e4b86d22.zip |
[Fix] Initialize lua debugging earlier
Diffstat (limited to 'lualib/lua_util.lua')
-rw-r--r-- | lualib/lua_util.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua index a6a99f2b6..4f185ecab 100644 --- a/lualib/lua_util.lua +++ b/lualib/lua_util.lua @@ -830,10 +830,11 @@ local debug_modules = {} local debug_aliases = {} local log_level = 384 -- debug + forced (1 << 7 | 1 << 8) -if type(rspamd_config) == 'userdata' then + +exports.init_debug_logging = function(config) local logger = require "rspamd_logger" -- Fill debug modules from the config - local logging = rspamd_config:get_all_opt('logging') + local logging = config:get_all_opt('logging') if logging then local log_level_str = logging.level if log_level_str then @@ -846,7 +847,7 @@ if type(rspamd_config) == 'userdata' then if logging.debug_modules then for _,m in ipairs(logging.debug_modules) do debug_modules[m] = true - logger.infox(rspamd_config, 'enable debug for Lua module %s', m) + logger.infox(config, 'enable debug for Lua module %s', m) end end @@ -854,7 +855,7 @@ if type(rspamd_config) == 'userdata' then for alias,mod in pairs(debug_aliases) do if debug_modules[mod] then debug_modules[alias] = true - logger.infox(rspamd_config, 'enable debug for Lua module %s (%s aliased)', + logger.infox(config, 'enable debug for Lua module %s (%s aliased)', alias, mod) end end |