mirror of
https://codeberg.org/AntumLuanti/mod-cleaner.git
synced 2025-03-21 15:41:22 +00:00
Fix logging method
This commit is contained in:
parent
839c32f5c0
commit
00ab41d6de
1 changed files with 10 additions and 1 deletions
11
init.lua
11
init.lua
|
@ -12,13 +12,22 @@ local cleaner_debug = core.settings:get_bool("enable_debug_mods", false)
|
||||||
function cleaner.log(lvl, msg)
|
function cleaner.log(lvl, msg)
|
||||||
if lvl == "debug" and not cleaner_debug then return end
|
if lvl == "debug" and not cleaner_debug then return end
|
||||||
|
|
||||||
|
if lvl and not msg then
|
||||||
|
msg = lvl
|
||||||
|
lvl = nil
|
||||||
|
end
|
||||||
|
|
||||||
msg = "[" .. cleaner.modname .. "] " .. msg
|
msg = "[" .. cleaner.modname .. "] " .. msg
|
||||||
if lvl == "debug" then
|
if lvl == "debug" then
|
||||||
msg = "[DEBUG] " .. msg
|
msg = "[DEBUG] " .. msg
|
||||||
lvl = nil
|
lvl = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
core.log(lvl, msg)
|
if not lvl then
|
||||||
|
core.log(msg)
|
||||||
|
else
|
||||||
|
core.log(lvl, msg)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue