From e8e4e63b58262a9046384f51758e271726e91170 Mon Sep 17 00:00:00 2001 From: Matías Insaurralde Date: Sat, 25 Apr 2026 05:11:02 +0000 Subject: [PATCH] appview/issues: replace log.Println with structured logging in opengraph.go Signed-off-by: Matías Insaurralde --- appview/issues/opengraph.go | 11 +++++------ 1 file(s) changed, 5 insertion(s)(+), 6 deletion(s)(-) diff --git a/appview/issues/opengraph.go b/appview/issues/opengraph.go --- a/appview/issues/opengraph.go +++ b/appview/issues/opengraph.go @@ -3,7 +3,6 @@ import ( "context" "fmt" - "log" "net/http" "time" @@ -17,13 +16,13 @@ func (rp *Issues) IssueOpenGraphSummary(w http.ResponseWriter, r *http.Request) { f, err := rp.repoResolver.Resolve(r) if err != nil { - log.Println("failed to get repo and knot", err) + rp.logger.Error("failed to get repo and knot", "err", err) return } issue, ok := r.Context().Value("issue").(*models.Issue) if !ok { - log.Println("issue not found in context") + rp.logger.Error("issue not found in context") http.Error(w, "issue not found", http.StatusNotFound) return } @@ -34,7 +33,7 @@ orm.FilterIn("at_uri", f.Labels), orm.FilterContains("scope", tangled.RepoIssueNSID), ) if err != nil { - log.Println("failed to fetch label definitions") + rp.logger.Error("failed to fetch label definitions", "err", err) http.Error(w, "label definitions not found", http.StatusInternalServerError) return } @@ -100,7 +99,7 @@ } imageBytes, err := rp.ogreClient.RenderIssueCard(r.Context(), payload) if err != nil { - log.Println("failed to render issue card", err) + rp.logger.Error("failed to render issue card", "err", err) http.Error(w, "failed to render issue card", http.StatusInternalServerError) return } @@ -110,7 +109,7 @@ w.Header().Set("Cache-Control", "public, max-age=3600") w.WriteHeader(http.StatusOK) _, err = w.Write(imageBytes) if err != nil { - log.Println("failed to write issue card", err) + rp.logger.Error("failed to write issue card", "err", err) return } } -- tangled.sh