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/cowsay/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples/cowsay/main.go') diff --git a/examples/cowsay/main.go b/examples/cowsay/main.go index fc5e89f..b239019 100644 --- a/examples/cowsay/main.go +++ b/examples/cowsay/main.go @@ -9,8 +9,8 @@ import ( "os/exec" "tildegit.org/tjp/gus" - guslog "tildegit.org/tjp/gus/contrib/log" "tildegit.org/tjp/gus/gemini" + "tildegit.org/tjp/gus/logging" ) func main() { @@ -23,11 +23,13 @@ func main() { log.Fatal(err) } + _, infoLog, _, errLog := logging.DefaultLoggers() + // add request logging to the request handler - handler := guslog.Requests(os.Stdout, nil)(cowsayHandler) + handler := logging.LogRequests(infoLog)(cowsayHandler) // run the server - server, err := gemini.NewServer(context.Background(), tlsconf, "tcp4", ":1965", handler) + server, err := gemini.NewServer(context.Background(), errLog, tlsconf, "tcp4", ":1965", handler) if err != nil { log.Fatal(err) } -- cgit v1.2.3