Expose function to create custom log entries
This commit is contained in:
parent
db2d30caaf
commit
fae9af96bf
|
@ -1056,7 +1056,7 @@ function core.get_views_referencing_doc(doc)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function log(level, show, backtrace, fmt, ...)
|
function core.custom_log(level, show, backtrace, fmt, ...)
|
||||||
local text = string.format(fmt, ...)
|
local text = string.format(fmt, ...)
|
||||||
if show then
|
if show then
|
||||||
local s = style.log[level]
|
local s = style.log[level]
|
||||||
|
@ -1081,20 +1081,20 @@ end
|
||||||
|
|
||||||
|
|
||||||
function core.log(...)
|
function core.log(...)
|
||||||
return log("INFO", true, false, ...)
|
return core.custom_log("INFO", true, false, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function core.log_quiet(...)
|
function core.log_quiet(...)
|
||||||
return log("INFO", false, false, ...)
|
return core.custom_log("INFO", false, false, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function core.warn(...)
|
function core.warn(...)
|
||||||
return log("WARN", true, true, ...)
|
return core.custom_log("WARN", true, true, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function core.error(...)
|
function core.error(...)
|
||||||
return log("ERROR", true, true, ...)
|
return core.custom_log("ERROR", true, true, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue