!7 static Map wsToState = weakHashMap(); static int interval = 200; static File fileToLog() { ret getProgramFile(#1013927, "versions.log"); } p { initWebSockets(); doEvery(interval, f update); } html { ret htitle_h3("Mech Live Log") + subBot_html_webSocketBasedLogView(); } svoid update { File f = fileToLog(); long len = fileSize(f); for (O ws : webSocketManager.webSockets) { Long l = wsToState.get(ws); if (l == null) wsToState.put(ws, l = 0L); if (len > l) { S newStuff = loadTextFilePart(f, l, len); wsToState.put(ws, len); call(ws, 'send, "+" + newStuff); } } }