diff --git a/sonic-radiance.love/core/debug.lua b/sonic-radiance.love/core/debug.lua index 17adcb8..a1cecb7 100644 --- a/sonic-radiance.love/core/debug.lua +++ b/sonic-radiance.love/core/debug.lua @@ -45,19 +45,25 @@ end function DebugSystem:print(context, string) if (self.active) then - print("[DEBUG] ".. context .. ": " .. string) + print(self:getLogLine("DEBUG", context, string)) end end function DebugSystem:warning(context, string) if (self.active) then - print("[WARNING] " .. context .. ": " .. string) + print(self:getLogLine("WARNING", context, string)) end end function DebugSystem:error(context, string) - if (self.active) then - error("[ERROR] " .. context .. ": " .. string) + error(self:getLogLine("ERROR", context, string)) +end + +function DebugSystem:getLogLine(type, string1, string2) + if (string2 == nil) then + return "[" .. type .. "] " .. string1 + else + return "[" .. type .. "] " .. string1 .. ": " .. string2 end end