Always show backtrace for `error` log entries
This commit is contained in:
parent
4f0d45d6ab
commit
c92f6a7b7f
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue