log.lua: Shouldn't assert on failed fs.open because this way it doesn't run on read only filesystem and really doesn't matter if it fails
This commit is contained in:
+3
-6
@@ -55,14 +55,11 @@ local logFileSizeLimit = 16384
|
||||
|
||||
local function writeToLog(path, text)
|
||||
fs.makeDirectory("halyde/logs") -- Git likes to not clone empty directories
|
||||
local handle
|
||||
if fs.exists(path) then
|
||||
handle = assert(fs.open(path, "a"))
|
||||
else
|
||||
handle = assert(fs.open(path, "w"))
|
||||
end
|
||||
local handle = fs.open(path, "a")
|
||||
if handle then
|
||||
handle:write(text .. "\n")
|
||||
handle:close()
|
||||
end
|
||||
|
||||
-- Log trimming if it gets too long
|
||||
if fs.size(path) > logFileSizeLimit then
|
||||
|
||||
Reference in New Issue
Block a user