log in logfmt via zap, with nicer console output in dev
1 file changed, 3 insertions(+), 3 deletions(-)
changed files
M internal/builder/template.go → internal/builder/template.go
@@ -4,7 +4,6 @@ import ( "encoding/xml" "fmt" "io" - "log/slog" "net/url" "os" "strings"@@ -12,6 +11,7 @@ "sync" "time" "website/internal/atom" "website/internal/config" + "website/internal/log" "github.com/PuerkitoBio/goquery" "github.com/a-h/htmlformat"@@ -391,12 +391,12 @@ // TODO: return errors to main thread go func() { _, err := w.Write([]byte("<!doctype html>\n")) if err != nil { - slog.Error("error writing doctype") + log.Error("error writing doctype", "error", err) w.CloseWithError(err) } err = htmlformat.Nodes(w, []*html.Node{doc.Children().Get(0)}) if err != nil { - slog.Error("error rendering html", "error", err) + log.Error("error rendering html", "error", err) w.CloseWithError(err) return }