feat(core/debug): add log functions
This commit is contained in:
parent
88526282ea
commit
543247e721
2 changed files with 24 additions and 0 deletions
|
@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- Add a gamesystem module
|
||||
|
||||
- **core/debug:** add log functions
|
||||
|
||||
### Changed
|
||||
|
||||
- **world:** extract map module from the world module
|
||||
|
|
|
@ -36,4 +36,26 @@ function DebugSystem:update(dt)
|
|||
lovebird.update(dt)
|
||||
end
|
||||
|
||||
-- PRINT FUNCTIONS
|
||||
-- Print and log debug string
|
||||
|
||||
function DebugSystem:print(context, string)
|
||||
if (self.active) then
|
||||
print("[DEBUG] ".. context .. ": " .. string)
|
||||
end
|
||||
end
|
||||
|
||||
function DebugSystem:warning(context, string)
|
||||
if (self.active) then
|
||||
print("[WARNING] " .. context .. ": " .. string)
|
||||
end
|
||||
end
|
||||
|
||||
function DebugSystem:error(context, string)
|
||||
if (self.active) then
|
||||
error("[ERROR] " .. context .. ": " .. string)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return DebugSystem
|
||||
|
|
Loading…
Reference in a new issue