From 50dedaa7c8ff912116346309d68ebef146534859 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Fri, 7 Nov 2025 18:52:13 +0000 Subject: [PATCH] OS log tagging to match PLC --- coordinator/threads.lua | 14 +++++++------- rtu/threads.lua | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/coordinator/threads.lua b/coordinator/threads.lua index dc7f3f2..86422db 100644 --- a/coordinator/threads.lua +++ b/coordinator/threads.lua @@ -34,7 +34,7 @@ function threads.thread__main(smem) -- execute thread function public.exec() iocontrol.fp_rt_status("main", true) - log.debug("main thread start") + log.debug("OS: main thread start") local loop_clock = util.new_clock(MAIN_CLOCK) @@ -143,10 +143,10 @@ function threads.thread__main(smem) -- check for termination request or UI crash if event == "terminate" or ppm.should_terminate() then crd_state.shutdown = true - log.info("terminate requested, main thread exiting") + log.info("OS: terminate requested, main thread exiting") elseif not crd_state.ui_ok then crd_state.shutdown = true - log.info("terminating due to fatal UI error") + log.info("OS: terminating due to fatal UI error") end if crd_state.shutdown then @@ -184,7 +184,7 @@ function threads.thread__main(smem) -- if status is true, then we are probably exiting, so this won't matter -- this thread cannot be slept because it will miss events (namely "terminate") if not crd_state.shutdown then - log.info("main thread restarting now...") + log.info("OS: main thread restarting now...") end end end @@ -202,7 +202,7 @@ function threads.thread__render(smem) -- execute thread function public.exec() iocontrol.fp_rt_status("render", true) - log.debug("render thread start") + log.debug("OS: render thread start") -- load in from shared memory local crd_state = smem.crd_state @@ -279,7 +279,7 @@ function threads.thread__render(smem) -- check for termination request if crd_state.shutdown then - log.info("render thread exiting") + log.info("OS: render thread exiting") break end @@ -301,7 +301,7 @@ function threads.thread__render(smem) iocontrol.fp_rt_status("render", false) if not crd_state.shutdown then - log.info("render thread restarting in 5 seconds...") + log.info("OS: render thread restarting in 5 seconds...") util.psleep(5) end end diff --git a/rtu/threads.lua b/rtu/threads.lua index 57fb288..b3e5d26 100644 --- a/rtu/threads.lua +++ b/rtu/threads.lua @@ -184,7 +184,7 @@ function threads.thread__main(smem) -- execute thread function public.exec() databus.tx_rt_status("main", true) - log.debug("main thread start") + log.debug("OS: main thread start") -- main loop clock local loop_clock = util.new_clock(MAIN_CLOCK) @@ -298,7 +298,7 @@ function threads.thread__main(smem) -- check for termination request if event == "terminate" or ppm.should_terminate() then rtu_state.shutdown = true - log.info("terminate requested, main thread exiting") + log.info("OS: terminate requested, main thread exiting") break end end @@ -317,7 +317,7 @@ function threads.thread__main(smem) databus.tx_rt_status("main", false) if not rtu_state.shutdown then - log.info("main thread restarting in 5 seconds...") + log.info("OS: main thread restarting in 5 seconds...") util.psleep(5) end end @@ -336,7 +336,7 @@ function threads.thread__comms(smem) -- execute thread function public.exec() databus.tx_rt_status("comms", true) - log.debug("comms thread start") + log.debug("OS: comms thread start") -- load in from shared memory local rtu_state = smem.rtu_state @@ -370,7 +370,7 @@ function threads.thread__comms(smem) -- max 100ms spent processing queue if util.time() - handle_start > 100 then - log.warning("comms thread exceeded 100ms queue process limit") + log.warning("OS: comms thread exceeded 100ms queue process limit") break end end @@ -381,7 +381,7 @@ function threads.thread__comms(smem) -- check for termination request if rtu_state.shutdown then rtu_comms.close(rtu_state) - log.info("comms thread exiting") + log.info("OS: comms thread exiting") break end @@ -403,7 +403,7 @@ function threads.thread__comms(smem) databus.tx_rt_status("comms", false) if not rtu_state.shutdown then - log.info("comms thread restarting in 5 seconds...") + log.info("OS: comms thread restarting in 5 seconds...") util.psleep(5) end end @@ -426,7 +426,7 @@ function threads.thread__unit_comms(smem, unit) -- execute thread function public.exec() databus.tx_rt_status("unit_" .. unit.uid, true) - log.debug(util.c("rtu unit thread start -> ", types.rtu_type_to_string(unit.type), " (", unit.name, ")")) + log.debug(util.c("OS: rtu unit thread start -> ", types.rtu_type_to_string(unit.type), " (", unit.name, ")")) -- load in from shared memory local rtu_state = smem.rtu_state @@ -443,7 +443,7 @@ function threads.thread__unit_comms(smem, unit) local short_name = util.c(types.rtu_type_to_string(unit.type), " (", unit.name, ")") if packet_queue == nil then - log.error("rtu unit thread created without a message queue, exiting...", true) + log.error("OS: rtu unit thread created without a message queue, exiting...", true) return end @@ -471,7 +471,7 @@ function threads.thread__unit_comms(smem, unit) -- check for termination request if rtu_state.shutdown then - log.info("rtu unit thread exiting -> " .. short_name) + log.info("OS: rtu unit thread exiting -> " .. short_name) break end @@ -536,7 +536,7 @@ function threads.thread__unit_comms(smem, unit) databus.tx_rt_status("unit_" .. unit.uid, false) if not rtu_state.shutdown then - log.info(util.c("rtu unit thread ", types.rtu_type_to_string(unit.type), " (", unit.name, ") restarting in 5 seconds...")) + log.info(util.c("OS: rtu unit thread ", types.rtu_type_to_string(unit.type), " (", unit.name, ") restarting in 5 seconds...")) util.psleep(5) end end