Expose function to create custom log entries

This commit is contained in:
Guldoman 2022-05-31 02:35:56 +02:00
parent db2d30caaf
commit fae9af96bf
No known key found for this signature in database
GPG Key ID: EA928C8BDA1A8825
1 changed files with 5 additions and 5 deletions

View File

@ -1056,7 +1056,7 @@ function core.get_views_referencing_doc(doc)
end
function log(level, show, backtrace, fmt, ...)
function core.custom_log(level, show, backtrace, fmt, ...)
local text = string.format(fmt, ...)
if show then
local s = style.log[level]
@ -1081,20 +1081,20 @@ end
function core.log(...)
return log("INFO", true, false, ...)
return core.custom_log("INFO", true, false, ...)
end
function core.log_quiet(...)
return log("INFO", false, false, ...)
return core.custom_log("INFO", false, false, ...)
end
function core.warn(...)
return log("WARN", true, true, ...)
return core.custom_log("WARN", true, true, ...)
end
function core.error(...)
return log("ERROR", true, true, ...)
return core.custom_log("ERROR", true, true, ...)
end