Operator: tee relay/console output to content/operator_relay.log

Every field bug this session needed the relay's OWN view to diagnose,
but the app only shows it in the (post-mortem-unreadable) GUI log pane.
Now _console_output also appends to content/operator_relay.log (fresh
per session; stderr is merged so relay tracebacks are captured too).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-18 18:29:33 -05:00
co-authored by Claude Fable 5
parent 196112f2dc
commit 9f1bd8d6d4
+13
View File
@@ -566,6 +566,10 @@ class Operator(QMainWindow):
for tag in tags:
host, _, port = tag.rpartition(":")
args.append("%s:%d" % (host, int(port) - 1))
try: # fresh relay log per session
open(os.path.join(CONTENT, "operator_relay.log"), "w").close()
except OSError:
pass
self.console_proc = QProcess(self)
self.console_proc.setProcessChannelMode(QProcess.MergedChannels)
self.console_proc.readyReadStandardOutput.connect(self._console_output)
@@ -630,6 +634,15 @@ class Operator(QMainWindow):
return
data = bytes(self.console_proc.readAllStandardOutput()).decode(
"utf-8", "replace")
# ALSO tee the relay/console output to a file -- the GUI log pane is
# not readable post-mortem, and every field bug so far needed the
# relay's own view to diagnose (2026-07-18).
try:
with open(os.path.join(CONTENT, "operator_relay.log"), "a",
encoding="utf-8") as f:
f.write(data)
except OSError:
pass
for line in data.splitlines():
if line.strip():
self.log.appendPlainText(line)