From 42dc83df805fe93ea43f1bb463cd46bef310a169 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 23 Jul 2026 21:23:09 +0000 Subject: [PATCH 1/4] Stop the instance console filter swallowing diagnostics The console's chat filter kept only Factorio output parsed as an action, which dropped the server's replies to those actions. Running a console command with a typo in it echoed the command and then appeared to print nothing, because "Cannot execute command. Error: ..." is a plain message rather than an [ACTION] line. Factorio's engine level errors were dropped the same way, so a failed multiplayer connection left no trace either. Filter by where a line came from instead. Factorio interleaves two streams on stdout: the date stamped console log, which carries what was done to the server and the replies to it, and the seconds stamped engine log, which is verbose diagnostic output. Keep the console log whole and take only warnings and errors from the engine log. Apply the same rule to Clusterio's own entries, which were previously kept in full and drowned the Factorio output they were mixed with. Keep those at warn or worse and drop the routine bookkeeping. Replayed over a development cluster's history this drops 415 informational lines and surfaces engine errors that were never visible in either mode. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/web_ui/src/components/LogConsole.tsx | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/web_ui/src/components/LogConsole.tsx b/packages/web_ui/src/components/LogConsole.tsx index c327d4ec..5db8da63 100644 --- a/packages/web_ui/src/components/LogConsole.tsx +++ b/packages/web_ui/src/components/LogConsole.tsx @@ -68,6 +68,24 @@ function formatLog(info: Info, key: number): ReactElement { return [{level}] {info.message}
; } +/** + * Test if a log entry survives the console's actions only filter + */ +function passesActionsOnly(info: Info) { + // Clusterio's own entries are bookkeeping, only keep those reporting a problem. + if (info.level !== "server") { + return lib.levels[info.level] <= lib.levels.warn; + } + + // Factorio's seconds stamped engine log is verbose diagnostics, only keep warnings and errors. + if (info.parsed?.format === "seconds") { + return info.parsed.level === "Warning" || info.parsed.level === "Error"; + } + + // What is left is the date stamped console log: the actions done to the server and the replies to them. + return true; +} + type LogConsoleProps = { all?: boolean; controller?: boolean; @@ -159,11 +177,7 @@ export default function LogConsole(props: LogConsoleProps) { "desc", )).then(result => { setPastLines(result.log - .filter(info => ( - !props.actionsOnly - || (info as Info).level !== "server" - || (info as Info).parsed?.type === "action" - )) + .filter(info => !props.actionsOnly || passesActionsOnly(info as Info)) .map((info, index) => formatLog(info as Info, -index - 1)) .reverse() ); @@ -175,7 +189,7 @@ export default function LogConsole(props: LogConsoleProps) { } function logHandler(info: Info) { - if (!props.actionsOnly || info.level !== "server" || info.parsed?.type === "action") { + if (!props.actionsOnly || passesActionsOnly(info)) { setLines(currentLines => currentLines.concat( [formatLog(info, currentLines.length)] )); From 16092ec967b35620fc3e8facae8ec65b5f0991d0 Mon Sep 17 00:00:00 2001 From: bbassie <17990055+bbassie@users.noreply.github.com> Date: Thu, 23 Jul 2026 21:23:23 +0000 Subject: [PATCH 2/4] Make the instance console log filter discoverable The filter was a Switch showing only the label of the mode it was already in, so with the default of chat mode it read as a button labelled "Chat" with no hint that a Log mode existed or that anything was being hidden. Swap it for a Segmented control listing both Chat and Log, so the mode that is not active is always visible, and add a tooltip describing what each one covers. Fixes #853 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/components/InstanceViewPage.tsx | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/web_ui/src/components/InstanceViewPage.tsx b/packages/web_ui/src/components/InstanceViewPage.tsx index 98a4b720..08b1775d 100644 --- a/packages/web_ui/src/components/InstanceViewPage.tsx +++ b/packages/web_ui/src/components/InstanceViewPage.tsx @@ -1,7 +1,8 @@ import React, { useContext, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; import { - Alert, Button, Descriptions, Dropdown, Flex, MenuProps, Modal, Space, Spin, Switch, Typography, message, + Alert, Button, Descriptions, Dropdown, Flex, MenuProps, Modal, Segmented, Space, Spin, Tooltip, Typography, + message, } from "antd"; import CopyOutlined from "@ant-design/icons/CopyOutlined"; import DeleteOutlined from "@ant-design/icons/DeleteOutlined"; @@ -34,7 +35,7 @@ import { MetricRelativeDate } from "./system_metrics"; type MenuItem = Required["items"][number]; const { Title } = Typography; -// Remembers the console "Chat/Log" toggle across reloads (defaults to on). +// Remembers the console "Game/Instance" selection across reloads (defaults to game). const consoleActionsOnlyKey = "instance-console-actions-only"; type InstanceDescriptionProps = { @@ -249,12 +250,22 @@ export default function InstanceViewPage() { { account.hasPermission("core.log.follow") && - + + setActionsOnly(value === "game")} + options={[ + { label: "Game", value: "game" }, + { label: "Instance", value: "instance" }, + ]} + /> + Date: Wed, 12 Aug 2026 10:58:30 +0000 Subject: [PATCH 3/4] Label Factorio output in the console with its log level The Web UI console rendered server level entries as bare parsed Factorio output, while every other level was prefixed with its name. Nothing in a line distinguished what the game wrote from what Clusterio wrote about it, which matters more now that both modes of the filter carry a mix of the two. Emit the [server] prefix for those entries as well, matching what TerminalFormat already does for the host and controller logs, and style the level the same bold the terminal colourises it with. Co-Authored-By: Claude Opus 5 (1M context) --- packages/web_ui/src/components/LogConsole.tsx | 10 ++++------ packages/web_ui/src/style.css | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/web_ui/src/components/LogConsole.tsx b/packages/web_ui/src/components/LogConsole.tsx index 5db8da63..0a201f0c 100644 --- a/packages/web_ui/src/components/LogConsole.tsx +++ b/packages/web_ui/src/components/LogConsole.tsx @@ -22,7 +22,7 @@ type Parsed = { message: string; }; -function formatParsedOutput(parsed: Parsed, key: number) { +function formatParsedOutput(parsed: Parsed) { let time: ReactElement|string = ""; if (parsed.format === "seconds") { time = {parsed.time.padStart(8)} ; @@ -51,7 +51,7 @@ function formatParsedOutput(parsed: Parsed, key: number) { info = <>[{parsed.action}] ; } - return {time}{info}{parsed.message}
; + return <>{time}{info}{parsed.message}; } type Info = { @@ -61,11 +61,9 @@ type Info = { }; function formatLog(info: Info, key: number): ReactElement { - if (info.level === "server" && info.parsed) { - return formatParsedOutput(info.parsed, key); - } let level = {info.level}; - return [{level}] {info.message}
; + let message = info.level === "server" && info.parsed ? formatParsedOutput(info.parsed) : info.message; + return [{level}] {message}
; } /** diff --git a/packages/web_ui/src/style.css b/packages/web_ui/src/style.css index 53cd7cdc..5553ceff 100644 --- a/packages/web_ui/src/style.css +++ b/packages/web_ui/src/style.css @@ -257,6 +257,10 @@ body { color: #ad3939; } +.log-server { + font-weight: bold; +} + .log-fatal { font-weight: bold; background-color: #ad3939; From 244d637fac946f0bdf5cb048a06276501f616537 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Wed, 12 Aug 2026 22:25:31 +0100 Subject: [PATCH 4/4] Reduce tooltip length --- packages/web_ui/src/components/InstanceViewPage.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/web_ui/src/components/InstanceViewPage.tsx b/packages/web_ui/src/components/InstanceViewPage.tsx index 08b1775d..ef55c97e 100644 --- a/packages/web_ui/src/components/InstanceViewPage.tsx +++ b/packages/web_ui/src/components/InstanceViewPage.tsx @@ -252,9 +252,8 @@ export default function InstanceViewPage() { &&