#138 fixed bug with dmesg output resetting to default if log file is recycled

This commit is contained in:
Mikayla Fischler 2022-12-18 14:11:25 -05:00
parent ca2983506e
commit 6fe257d1d7
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
local renderer = require("coordinator.renderer")
local sounder = require("coordinator.sounder")
local COORDINATOR_VERSION = "beta-v0.8.5"
local COORDINATOR_VERSION = "beta-v0.8.6"
local print = util.print
local println = util.println

View File

@ -81,10 +81,12 @@ local function _log(msg)
end
if out_of_space or (free_space(_log_sys.path) < 100) then
-- delete the old log file and open a new one
-- delete the old log file before opening a new one
_log_sys.file.close()
fs.delete(_log_sys.path)
log.init(_log_sys.path, _log_sys.mode)
-- re-init logger and pass dmesg_out so that it doesn't change
log.init(_log_sys.path, _log_sys.mode, _log_sys.dmesg_out)
-- leave a message
_log_sys.file.writeLine(time_stamp .. "recycled log file")