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:
@ -19,7 +19,7 @@ local iocontrol = require("coordinator.iocontrol")
|
|||||||
local renderer = require("coordinator.renderer")
|
local renderer = require("coordinator.renderer")
|
||||||
local sounder = require("coordinator.sounder")
|
local sounder = require("coordinator.sounder")
|
||||||
|
|
||||||
local COORDINATOR_VERSION = "beta-v0.8.5"
|
local COORDINATOR_VERSION = "beta-v0.8.6"
|
||||||
|
|
||||||
local print = util.print
|
local print = util.print
|
||||||
local println = util.println
|
local println = util.println
|
||||||
|
@ -81,10 +81,12 @@ local function _log(msg)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if out_of_space or (free_space(_log_sys.path) < 100) then
|
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()
|
_log_sys.file.close()
|
||||||
fs.delete(_log_sys.path)
|
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
|
-- leave a message
|
||||||
_log_sys.file.writeLine(time_stamp .. "recycled log file")
|
_log_sys.file.writeLine(time_stamp .. "recycled log file")
|
||||||
|
Reference in New Issue
Block a user