From 6fe257d1d75ff763b22e50fca27a712ec506bc69 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sun, 18 Dec 2022 14:11:25 -0500 Subject: [PATCH] #138 fixed bug with dmesg output resetting to default if log file is recycled --- coordinator/startup.lua | 2 +- scada-common/log.lua | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/coordinator/startup.lua b/coordinator/startup.lua index 5faab51..c5072d1 100644 --- a/coordinator/startup.lua +++ b/coordinator/startup.lua @@ -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 diff --git a/scada-common/log.lua b/scada-common/log.lua index 1a44356..2aeb714 100644 --- a/scada-common/log.lua +++ b/scada-common/log.lua @@ -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")