From 0fecaaa236874b0b288103e9e33f41cb6252d0d8 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Wed, 3 Jun 2026 11:02:44 -0400 Subject: [PATCH] =?UTF-8?q?zebra-report:=20deploy=20=E2=80=94=20client-log?= =?UTF-8?q?=20telemetry=20forward?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zebra-report/zebra-spaces.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zebra-report/zebra-spaces.html b/zebra-report/zebra-spaces.html index b6aa8f4..c8e74f5 100644 --- a/zebra-report/zebra-spaces.html +++ b/zebra-report/zebra-spaces.html @@ -783,6 +783,16 @@ function logLine(kind, msg){ const d=document.createElement('div'); d.className='log-line '+(kind||''); d.innerHTML=''+new Date().toLocaleTimeString()+' '+msg.replace(/[&<>]/g,c=>({'&':'&','<':'<','>':'>'}[c])); logEl.appendChild(d); logEl.scrollTop=logEl.scrollHeight; + /* Forward to signal so an operator can grep /var/log/zebra-spaces- + * signal.log for CLIENT_LOG across every connected peer without + * copy-pasting from individual browser tabs. Best-effort: silently + * drops if the WS isn't open. Only RTC/system events flow through + * logLine — no user-typed content. */ + try { + if (typeof ws !== 'undefined' && ws && ws.readyState === 1){ + ws.send(JSON.stringify({ type: 'client-log', kind: kind || '', msg: String(msg).slice(0, 2000) })); + } + } catch(_){} } /* pubHex straight from a server message — prefers the explicit hex field, @@ -3870,8 +3880,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');