summaryrefslogtreecommitdiff
path: root/examples/cowsay
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/cowsay
parentdf57a12539030297b3254bc81f5696691cbc9c6f (diff)
logging library up to top level
Diffstat (limited to 'examples/cowsay')
-rw-r--r--examples/cowsay/main.go8
1 files changed, 5 insertions, 3 deletions
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)
}