From 0480e066a3f1ae97dbab8fcb6303589eb0fa724c Mon Sep 17 00:00:00 2001 From: tjpcc Date: Mon, 23 Jan 2023 22:15:16 -0700 Subject: logging library up to top level --- examples/cgi/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples/cgi') diff --git a/examples/cgi/main.go b/examples/cgi/main.go index 3dfec29..6036454 100644 --- a/examples/cgi/main.go +++ b/examples/cgi/main.go @@ -8,8 +8,8 @@ import ( "syscall" "tildegit.org/tjp/gus/contrib/cgi" - guslog "tildegit.org/tjp/gus/contrib/log" "tildegit.org/tjp/gus/gemini" + "tildegit.org/tjp/gus/logging" ) func main() { @@ -25,15 +25,17 @@ func main() { // make use of a CGI request handler cgiHandler := cgi.CGIDirectory("/cgi-bin", "./cgi-bin") + _, infoLog, _, errLog := logging.DefaultLoggers() + // add stdout logging to the request handler - handler := guslog.Requests(os.Stdout, nil)(cgiHandler) + handler := logging.LogRequests(infoLog)(cgiHandler) // set up signals to trigger graceful shutdown ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGHUP) defer stop() // run the server - server, err := gemini.NewServer(ctx, tlsconf, "tcp4", ":1965", handler) + server, err := gemini.NewServer(ctx, errLog, tlsconf, "tcp4", ":1965", handler) if err != nil { log.Fatal(err) } -- cgit v1.2.3