Enhance log file handling

This commit is contained in:
Fierelier 2021-09-12 18:55:02 +02:00
parent c11fdadfad
commit c3866b5008
1 changed files with 7 additions and 2 deletions

View File

@ -21,9 +21,11 @@ blacklistObjects = {}
-- blacklistObjects[7323] = true
tempObj = false
logpath = "log.txt"
if fileExists(logpath) then fileDelete(logpath) end
logfile = fileCreate(logpath)
if debugToggle then
logpath = "log.txt"
logfile = fileCreate(logpath)
end
function registerCollisionArchive(path)
cols = engineGetCOLsFromLibrary(path)
@ -153,5 +155,8 @@ addEventHandler("onClientResourceStop",root,function(res)
for key,_ in pairs(objectRegister) do
engineFreeModel(objectRegister[key]["realID"])
end
if debugToggle then
fileClose(logpath)
end
end
end)