summaryrefslogtreecommitdiff
path: root/examples/fileserver
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-01-23 22:15:16 -0700
committertjpcc <tjp@ctrl-c.club>2023-01-23 22:15:16 -0700
commit0480e066a3f1ae97dbab8fcb6303589eb0fa724c (patch)
tree1aa347eb3691a29987475fcf6049343aa227a365 /examples/fileserver
parentdf57a12539030297b3254bc81f5696691cbc9c6f (diff)
logging library up to top level
Diffstat (limited to 'examples/fileserver')
-rw-r--r--examples/fileserver/main.go9
1 files changed, 6 insertions, 3 deletions
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)
}