mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-24 21:14:44 +01:00
15 lines
341 B
Go
15 lines
341 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/lukerodham/tuu"
|
|
)
|
|
|
|
// RequestLogger is a default/example implementation of how a logging middleware would be implemented.
|
|
func RequestLogger(next tuu.Handler) tuu.Handler {
|
|
return func(c tuu.Context) error {
|
|
c.Logger().WithField("url", c.Value("path")).Info("New request")
|
|
|
|
return next(c)
|
|
}
|
|
}
|