feat: add a fail log function
This commit is contained in:
parent
0f4b6daf73
commit
b22cc2159f
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue