all repos — homestead @ 5d9c9686873144c01604e57b5710ab8d921dcbac

Code for my website

log in logfmt via zap, with nicer console output in dev

Alan Pearce
commit

5d9c9686873144c01604e57b5710ab8d921dcbac

parent

09c04603a0eb92bdb811dd7f7d5f130d35fa0adf

1 file changed, 3 insertions(+), 3 deletions(-)

changed files
M internal/builder/template.gointernal/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 }