From 96e31f8c475b40f936ab7465b1dd3fccae84cb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 29 Oct 2026 01:42:29 +0100 Subject: [PATCH] WebSocket debugger: Enabling a log channel turns logging on Headless turns logging as a whole off without --log, so a channel enabled with log.channel.set still logged nothing, and a client watching the log events saw none. Co-Authored-By: Claude Opus 5.5 --- Core/Debugger/WebSocket/LogConfigSubscriber.cpp | 6 ++++++ docs/WebSocketDebugger.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/Debugger/WebSocket/LogConfigSubscriber.cpp b/Core/Debugger/WebSocket/LogConfigSubscriber.cpp index 895653b808..352d95ad03 100644 --- a/Core/Debugger/WebSocket/LogConfigSubscriber.cpp +++ b/Core/Debugger/WebSocket/LogConfigSubscriber.cpp @@ -20,6 +20,7 @@ // keeps its existing numeric 'level' - only this newer API uses level names, for readability). #include "Common/Log/LogManager.h" +#include "Core/Config.h" #include "Core/Debugger/WebSocket/LogConfigSubscriber.h" #include "Core/Debugger/WebSocket/WebSocketUtils.h" @@ -126,6 +127,11 @@ void WebSocketLogChannelSet(DebuggerRequest &req) { g_logManager.SetLogLevel(type, level); if (hasEnabled) g_logManager.SetEnabled(type, enabled); + // A channel logs nothing while logging as a whole is off, as it is in headless without --log. + if (hasEnabled && enabled && !g_Config.bEnableLogging) { + g_Config.bEnableLogging = true; + g_Config.DoNotSaveSetting(&g_Config.bEnableLogging); + } const LogChannel *chan = g_logManager.GetLogChannel(type); JsonWriter &json = req.Respond(); diff --git a/docs/WebSocketDebugger.md b/docs/WebSocketDebugger.md index 56b2b1195f..d4409e2b9e 100644 --- a/docs/WebSocketDebugger.md +++ b/docs/WebSocketDebugger.md @@ -289,7 +289,7 @@ file - this is just an index. | Input injection | `input.buttons.send`, `input.buttons.press`, `input.analog.send` | `InputSubscriber.cpp` | | Replay | `replay.begin/abort/flush/execute/status`, `replay.time.get/set` | `ReplaySubscriber.cpp` | | Client config | `broadcast.config.get/set`, `client.config.get/set` | `ClientConfigSubscriber.cpp` | -| Log channels | `log.channels.list`, `log.channel.set` - query/change a log channel's level (string: `notice`/`error`/`warning`/`info`/`debug`/`verbose`) and/or enabled state; the `log` event itself (the passive message stream, unaffected by this) keeps its existing numeric `level`, see `LogBroadcaster.cpp` | `LogConfigSubscriber.cpp` | +| Log channels | `log.channels.list`, `log.channel.set` - query/change a log channel's level (string: `notice`/`error`/`warning`/`info`/`debug`/`verbose`) and/or enabled state, enabling one also turns logging as a whole on, which headless has off without `--log`; the `log` event itself (the passive message stream, unaffected by this) keeps its existing numeric `level`, see `LogBroadcaster.cpp` | `LogConfigSubscriber.cpp` | ## Enabling it