aboutsummaryrefslogtreecommitdiff
path: root/logger.go
diff options
context:
space:
mode:
Diffstat (limited to 'logger.go')
-rw-r--r--logger.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/logger.go b/logger.go
index 7ebccff..14891d2 100644
--- a/logger.go
+++ b/logger.go
@@ -3,13 +3,15 @@ package main
import (
"log"
- "git.sr.ht/~yotam/go-gemini"
+ gemini "git.sr.ht/~yotam/go-gemini"
)
+// LoggingHandler wrap a Gemini handler and log all the requsts and responses
type LoggingHandler struct {
handler gemini.Handler
}
+// Handle implement the gemini.Handler interface by logging each request and response
func (h LoggingHandler) Handle(req gemini.Request) gemini.Response {
log.Println("Received request for", req.URL)