Done log file, log print automaticaly log writes

This commit is contained in:
bizcochito 2022-02-07 09:58:33 +01:00
parent 609a3d79cd
commit 19c5487789
2 changed files with 5 additions and 1 deletions

View File

@ -90,8 +90,9 @@ end]]
function logPrint(string) function logPrint(string)
if logging then print(string) end if logging then print(string) end
logWrite(string)
end end
function logWrite(string) function logWrite(string)
if logging then print(string) end if logging then love.filesystem.append(logFile, string) end
end end

View File

@ -45,3 +45,6 @@ return {
objects = {} objects = {}
} }
]] ]]
logFile = "mothback_"..os.date("%Y-%m-%d_%H-%M-%S")..".log"
local success, message = love.filesystem.write(logFile, "")
if message ~= nil then print(message) end