diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-15 11:20:24 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-15 11:20:24 +0900 |
| commit | a6b88139afc7c994ddb604757304d44214c00a90 (patch) | |
| tree | bf24da786c5fb292991fd1ad893522601ce98aa4 /backend/game | |
| parent | 96fad1a4e78c7209e5a0f3496e8b59d591fbe500 (diff) | |
| download | phperkaigi-2026-albatross-a6b88139afc7c994ddb604757304d44214c00a90.tar.gz phperkaigi-2026-albatross-a6b88139afc7c994ddb604757304d44214c00a90.tar.zst phperkaigi-2026-albatross-a6b88139afc7c994ddb604757304d44214c00a90.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'backend/game')
| -rw-r--r-- | backend/game/hub.go | 6 |
1 files changed, 4 insertions, 2 deletions
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) } }() |
