mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#138 fixed bug with dmesg output resetting to default if log file is recycled
This commit is contained in:
parent
ca2983506e
commit
6fe257d1d7
@ -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
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user