summaryrefslogtreecommitdiff
path: root/examples/fileserver
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-10-09 08:58:31 -0600
committertjpcc <tjp@ctrl-c.club>2023-10-09 08:58:31 -0600
commit20be557b7bc3d7ada78411b7b279c9f7580d0bc7 (patch)
tree2a7f6640b0b389ad79fe18a8906642be493aaf60 /examples/fileserver
parentcedcf58ea7d729acb6ed1a9ab7aec1ae38aed102 (diff)
logging.Base()
Allow users to get access to the base logger *before* it is wrapped with the various levels. This provides a single override point to filter or redirect all logging.
Diffstat (limited to 'examples/fileserver')
-rw-r--r--examples/fileserver/main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/fileserver/main.go b/examples/fileserver/main.go
index e90fdd9..2801858 100644
--- a/examples/fileserver/main.go
+++ b/examples/fileserver/main.go
@@ -5,6 +5,7 @@ import (
"log"
"os"
+ "github.com/go-kit/log/level"
sr "tildegit.org/tjp/sliderule"
"tildegit.org/tjp/sliderule/contrib/fs"
"tildegit.org/tjp/sliderule/gemini"
@@ -35,13 +36,13 @@ func main() {
router.Route("/*", handler)
handler = router.Handler()
- _, infoLog, _, errLog := logging.DefaultLoggers()
+ baseLog := logging.Base()
// add request logging to stdout
- handler = logging.LogRequests(infoLog)(handler)
+ handler = logging.LogRequests(level.Info(baseLog))(handler)
// run the server
- server, err := gemini.NewServer(context.Background(), "localhost", "tcp4", ":1965", handler, errLog, tlsconf)
+ server, err := gemini.NewServer(context.Background(), "localhost", "tcp4", ":1965", handler, baseLog, tlsconf)
if err != nil {
log.Fatal(err)
}