feat: add a fail log function

This commit is contained in:
Kazhnuz 2021-01-17 12:44:25 +01:00
parent 0f4b6daf73
commit b22cc2159f

View file

@ -125,6 +125,17 @@ function DebugSystem:logError(context, string)
end
end
--- Log an error and fail
--
-- @param context the context of the log
-- @param string the logged string
function DebugSystem:fail(context, string)
if (self:isError()) then
print(self:createLogLine("ERROR", context, string))
error(string)
end
end
--- Create a formatted debug line
--
-- @param level the level of the log