diff --git a/data/core/init.lua b/data/core/init.lua index 74471006..884c77bf 100644 --- a/data/core/init.lua +++ b/data/core/init.lua @@ -1056,7 +1056,7 @@ function core.get_views_referencing_doc(doc) end -local function log(level, show, fmt, ...) +function log(level, show, backtrace, fmt, ...) local text = string.format(fmt, ...) if show then local s = style.log[level] @@ -1069,7 +1069,8 @@ local function log(level, show, fmt, ...) level = level, text = text, time = os.time(), - at = at + at = at, + info = backtrace and debug.traceback(nil, 2):gsub("\t", "") } table.insert(core.log_items, item) if #core.log_items > config.max_log_items then @@ -1080,17 +1081,17 @@ end function core.log(...) - return log("INFO", true, ...) + return log("INFO", true, false, ...) end function core.log_quiet(...) - return log("INFO", false, ...) + return log("INFO", false, false, ...) end function core.error(...) - return log("ERROR", true, ...) + return log("ERROR", true, true, ...) end