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/fileserver/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'examples/fileserver/main.go') diff --git a/examples/fileserver/main.go b/examples/fileserver/main.go index 35c8708..e70974f 100644 --- a/examples/fileserver/main.go +++ b/examples/fileserver/main.go @@ -7,8 +7,8 @@ import ( "tildegit.org/tjp/gus" "tildegit.org/tjp/gus/contrib/fs" - guslog "tildegit.org/tjp/gus/contrib/log" "tildegit.org/tjp/gus/gemini" + "tildegit.org/tjp/gus/logging" ) func main() { @@ -32,11 +32,14 @@ func main() { // finally, try to find a file at the request path and respond with that fs.FileHandler(fileSystem), ) + + _, infoLog, _, errLog := logging.DefaultLoggers() + // add request logging to stdout - handler = guslog.Requests(os.Stdout, nil)(handler) + handler = logging.LogRequests(infoLog)(handler) // 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