From 33648cc286e812a8603743c29e96830de3b4acb8 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 9 Sep 2023 08:42:21 -0600 Subject: log stderr on failed CGIs --- internal/server.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/server.go') diff --git a/internal/server.go b/internal/server.go index f2b3485..1ae594b 100644 --- a/internal/server.go +++ b/internal/server.go @@ -5,6 +5,8 @@ import ( "net" "strings" "sync" + + "tildegit.org/tjp/sliderule/logging" ) type logger interface { @@ -40,6 +42,12 @@ func NewServer( networkAddr := listener.Addr() ctx, cancel := context.WithCancel(ctx) + debuglog, infolog, warnlog, errlog := logging.DefaultLoggers() + ctx = context.WithValue(ctx, "debuglog", debuglog) + ctx = context.WithValue(ctx, "infolog", infolog) + ctx = context.WithValue(ctx, "warnlog", warnlog) + ctx = context.WithValue(ctx, "errlog", errlog) + return Server{ Ctx: ctx, Cancel: cancel, -- cgit v1.2.3