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/api/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/api/handler.go') diff --git a/backend/api/handler.go b/backend/api/handler.go index 9f8849c..05a185a 100644 --- a/backend/api/handler.go +++ b/backend/api/handler.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "errors" - "log" + "log/slog" "net/http" "strconv" "time" @@ -47,7 +47,7 @@ func (h *Handler) PostLogin(ctx context.Context, request PostLoginRequestObject) password := request.Body.Password userID, err := auth.Login(ctx, h.q, username, password) if err != nil { - log.Printf("login failed: %v", err) + slog.Error("login failed", "error", err) var msg string if errors.Is(err, auth.ErrForteeLoginTimeout) { msg = "ログインに失敗しました" -- cgit v1.3.1