From 5fdaa269fdfb315a90ee4dd5a3c648d8dcdf3135 Mon Sep 17 00:00:00 2001 From: Lukas Kropatschek Date: Sat, 5 Mar 2016 13:24:48 +0100 Subject: [PATCH] Fix logger if debug module is sanitized. --- mist.lua | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mist.lua b/mist.lua index 2e72536..2d8449f 100644 --- a/mist.lua +++ b/mist.lua @@ -6417,15 +6417,19 @@ do -- mist.Logger scope text = text:gsub('$' .. index, value) end end - local dInfo = debug.getinfo(3) - local fName = dInfo.name - -- local fsrc = dinfo.short_src - --local fLine = dInfo.linedefined - local cLine = dInfo.currentline - if fName then + if debug then + local dInfo = debug.getinfo(3) + local fName = dInfo.name + local cLine = dInfo.currentline + -- local fsrc = dinfo.short_src + --local fLine = dInfo.linedefined + end + if fName and cLine then return fName .. '|' .. cLine .. ': ' .. text - else + elseif cLine then return cLine .. ': ' .. text + else + return ' ' .. text end end