From 00ab41d6de69f3b9d9ff0299544e4539e24fa781 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Tue, 18 May 2021 19:57:24 -0700 Subject: [PATCH] Fix logging method --- init.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2119774..42e47c0 100644 --- a/init.lua +++ b/init.lua @@ -12,13 +12,22 @@ local cleaner_debug = core.settings:get_bool("enable_debug_mods", false) function cleaner.log(lvl, msg) 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 if lvl == "debug" then msg = "[DEBUG] " .. msg lvl = nil end - core.log(lvl, msg) + if not lvl then + core.log(msg) + else + core.log(lvl, msg) + end end