Files
inp2025/backend/middlewares/accessLog.go
2025-09-10 02:53:48 +08:00

19 lines
395 B
Go

package middlewares
import (
"net/http"
"gitea.konchin.com/ytshih/inp2025/game/tracing"
"github.com/uptrace/bunrouter"
)
func (self *Handlers) AccessLog(
next bunrouter.HandlerFunc,
) bunrouter.HandlerFunc {
return func(w http.ResponseWriter, req bunrouter.Request) error {
tracing.Logger.Ctx(req.Context()).
Info(req.Method + " " + req.Params().Route())
return next(w, req)
}
}