diff --git a/reactor-plc/config.lua b/reactor-plc/config.lua index dceeb21..43086d5 100644 --- a/reactor-plc/config.lua +++ b/reactor-plc/config.lua @@ -6,3 +6,9 @@ REACTOR_ID = 1 SERVER_PORT = 16000 -- port to listen to incoming packets FROM server LISTEN_PORT = 14001 +-- log path +LOG_PATH = "/log.txt" +-- log mode +-- 0 = APPEND (adds to existing file on start) +-- 1 = NEW (replaces existing file on start) +LOG_MODE = 0 diff --git a/reactor-plc/startup.lua b/reactor-plc/startup.lua index 2952191..69038d3 100644 --- a/reactor-plc/startup.lua +++ b/reactor-plc/startup.lua @@ -19,7 +19,7 @@ local println = util.println local print_ts = util.print_ts local println_ts = util.println_ts -log.init("/log.txt", log.MODE.APPEND) +log.init(config.LOG_PATH, config.LOG_MODE) log._info("========================================") log._info("BOOTING reactor-plc.startup " .. R_PLC_VERSION) diff --git a/rtu/config.lua b/rtu/config.lua index 71804a4..6ba5653 100644 --- a/rtu/config.lua +++ b/rtu/config.lua @@ -4,6 +4,12 @@ SERVER_PORT = 16000 -- port to listen to incoming packets FROM server LISTEN_PORT = 15001 +-- log path +LOG_PATH = "/log.txt" +-- log mode +-- 0 = APPEND (adds to existing file on start) +-- 1 = NEW (replaces existing file on start) +LOG_MODE = 0 -- RTU peripheral devices (named: side/network device name) RTU_DEVICES = { { diff --git a/rtu/startup.lua b/rtu/startup.lua index 6220ad1..59c4354 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -26,7 +26,7 @@ local println = util.println local print_ts = util.print_ts local println_ts = util.println_ts -log.init("/log.txt", log.MODE.APPEND) +log.init(config.LOG_PATH, config.LOG_MODE) log._info("========================================") log._info("BOOTING rtu.startup " .. RTU_VERSION) diff --git a/supervisor/config.lua b/supervisor/config.lua index fde20b3..b8ba7fa 100644 --- a/supervisor/config.lua +++ b/supervisor/config.lua @@ -4,3 +4,9 @@ SCADA_DEV_LISTEN = 16000 SCADA_SV_LISTEN = 16100 -- expected number of reactors NUM_REACTORS = 4 +-- log path +LOG_PATH = "/log.txt" +-- log mode +-- 0 = APPEND (adds to existing file on start) +-- 1 = NEW (replaces existing file on start) +LOG_MODE = 0 diff --git a/supervisor/startup.lua b/supervisor/startup.lua index 9cf704a..946ef0c 100644 --- a/supervisor/startup.lua +++ b/supervisor/startup.lua @@ -25,7 +25,7 @@ local println = util.println local print_ts = util.print_ts local println_ts = util.println_ts -log.init("/log.txt", log.MODE.APPEND) +log.init(config.LOG_PATH, config.LOG_MODE) log._info("========================================") log._info("BOOTING supervisor.startup " .. SUPERVISOR_VERSION)