~bigbes/sr-ht-spec: 643fa0b5

logging: log through slog and scribe rather than stdlib log

sr-ht-ecore's panic middleware now reports through log/slog, and it reports
through the *default* logger — nothing can hand a middleware in another module
this service's *slog.Logger. So the daemon's scribe handler becomes the one
install point, and the packages that were still calling log.Printf go through
the default logger too: the read plane's render and encode failures, its 5xx
mapping, and the credential resolver's fail-closed line. Each carries the fields
that used to be interpolated into the sentence — method, path, status, page,
doc — and the error itself through scribe.Err.

The handler grows what it was missing: file:line, because most of what reaches
it is a failure and 'which of the six render sites' is the first question;
colour dropped when stderr is not a terminal; and the masks. This daemon handles
the unified-login cookie and tokens.sr.ht working tokens, and a struct logged
whole is how a live credential outlives its own request in a log file — masking
in the handler covers the log line nobody reviewed as well as these.

cmd/specsrht-migrate keeps stdlib log on purpose: it is a one-shot CLI whose
'specsrht-migrate: ...' progress an operator reads at the terminal during an
upgrade, and log.Fatalf is its error exit.

Eugene Blikh <bigbes@gmail.com> — 2026-08-08 19:56:49 UTC

Commit 643fa0b5d34a047923791d23f11ab585dd7487d5view raw patch

Parent(s): 3a56ee61

8 changed file(s)

FileStatus+
authn/resolver.go M +6 -2
cmd/specsrht/main.go M +29
web/diff.go M +5 -2
web/handlers.go M +16 -8
web/inbox.go M +5 -2
web/proposal.go M +4 -2
web/server.go M +3 -3
web/templates.go M +4 -2