From a6b88139afc7c994ddb604757304d44214c00a90 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 15 Feb 2026 11:20:24 +0900 Subject: refactor(log): migrate from log to log/slog for structured logging Replace all usages of the standard log package with log/slog across backend and swift worker. Configure Echo's request logger to emit structured log attributes via slog instead of the default format. Co-Authored-By: Claude Opus 4.6 --- backend/game/hub.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'backend/game') diff --git a/backend/game/hub.go b/backend/game/hub.go index 910911a..9ae725a 100644 --- a/backend/game/hub.go +++ b/backend/game/hub.go @@ -2,7 +2,8 @@ package game import ( "context" - "log" + "log/slog" + "os" "regexp" "strings" @@ -29,7 +30,8 @@ func NewGameHub(q *db.Queries, taskQueue *taskqueue.Queue, taskWorker *taskqueue func (hub *Hub) Run() { go func() { if err := hub.taskWorker.Run(); err != nil { - log.Fatal(err) + slog.Error("task worker failed", "error", err) + os.Exit(1) } }() -- cgit v1.3.1