]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Show the proper frame when using lua_util.debugm
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Sep 2018 15:50:20 +0000 (16:50 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Sep 2018 15:50:20 +0000 (16:50 +0100)
lualib/lua_util.lua

index 4b18d854cf7fc2734da97e3a9cf0524fa6a66ea0..2a2a80fc5e2302d92f7bb9d6613b002280a8be7e 100644 (file)
@@ -732,10 +732,14 @@ if type(rspamd_config) == 'userdata' then
   end
 end
 
-exports.debugm = function(mod, ...)
+exports.debugm = function(mod, obj_or_fmt, fmt_or_something, ...)
   local logger = require "rspamd_logger"
   if unconditional_debug or debug_modules[mod] then
-    logger.logx(log_level, mod, ...)
+    if type(obj_or_fmt) == 'string' then
+      logger.logx(log_level, mod, 2, obj_or_fmt, fmt_or_something, ...)
+    else
+      logger.logx(log_level, mod, obj_or_fmt, 2, fmt_or_something, ...)
+    end
   end
 end