diff --git a/station_broadcast.lua b/station_broadcast.lua index 932544f..5290576 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -18,7 +18,7 @@ local CONFIG = { ALERT_COOLDOWN_MS = 300000, APPROACHING_COOLDOWN_MS = 120000, APPROACHING_STABLE_MS = 5000, - DEBUG = true + DEBUG = false } local dfpwm = require "cc.audio.dfpwm" @@ -154,6 +154,7 @@ end local Utils = {} function Utils.log(level, message) + if level == "DEBUG" and not CONFIG.DEBUG then return end local timestamp = os.date("%H:%M:%S") local entryText = string.format("[%s][%s] %s", timestamp, level, message) local entry = { level = level, text = entryText } @@ -2640,16 +2641,6 @@ function Main.loop() cleanupTimestampMap(State.announcedAlerts, now, tonumber(CONFIG.ALERT_COOLDOWN_MS) or 300000) for i, stop in ipairs(data.TrainStops) do - -- [DEBUG] Dump first stop to file for inspection - if i == 1 and not State.dumpedStop then - State.dumpedStop = true - local f = fs.open("stop_dump.json", "w") - if f then - f.write(textutils.serializeJSON(stop)) - f.close() - Utils.log("DEBUG", "Dumped stop structure to stop_dump.json") - end - end local st = stop.Station if st then local trainName = st.TrainName or "Unknown"