summaryrefslogtreecommitdiff
path: root/examples/inspectls
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/inspectls
parentdf57a12539030297b3254bc81f5696691cbc9c6f (diff)
logging library up to top level
Diffstat (limited to 'examples/inspectls')
-rw-r--r--examples/inspectls/main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/inspectls/main.go b/examples/inspectls/main.go
index 65c5229..5022888 100644
--- a/examples/inspectls/main.go
+++ b/examples/inspectls/main.go
@@ -13,8 +13,8 @@ import (
"strings"
"tildegit.org/tjp/gus"
- guslog "tildegit.org/tjp/gus/contrib/log"
"tildegit.org/tjp/gus/gemini"
+ "tildegit.org/tjp/gus/logging"
)
func main() {
@@ -27,11 +27,13 @@ func main() {
log.Fatal(err)
}
+ _, infoLog, _, errLog := logging.DefaultLoggers()
+
// add stdout logging to the request handler
- handler := guslog.Requests(os.Stdout, nil)(inspectHandler)
+ handler := logging.LogRequests(infoLog)(inspectHandler)
// 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)
}