Implemented a real-time console log streaming via WebSocket for debugging purposes. Users can enable console output in settings to view application logs directly in the web interface.

This commit is contained in:
2026-01-14 21:47:17 +01:00
parent e997059e2a
commit 44da16977c
16 changed files with 501 additions and 15 deletions

View File

@@ -82,6 +82,15 @@ func main() {
wsHub := web.NewHub()
go wsHub.Run()
// Setup console log writer to capture stdout and send via WebSocket
web.SetupConsoleLogWriter(wsHub)
// Update enabled state based on current settings
web.UpdateConsoleLogEnabled()
// Register callback to update console log state when settings change
config.SetUpdateConsoleLogStateFunc(func(enabled bool) {
web.SetConsoleLogEnabled(enabled)
})
// Register all application routes, including the static files and templates.
web.RegisterRoutes(router, wsHub)