u
This commit is contained in:
1 parent
7c8e2906bc
commit
72a1a9184a
25 files changed
+744
-125
No files matched your search
@@ -0,0 +1,15 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"base-framework/pkg/router"
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Logger() router.HandlerFunc {
|
||||
return func(c *router.Context) {
|
||||
start := time.Now()
|
||||
c.Next()
|
||||
log.Printf("[%s] %s in %v", c.Request.Method, c.Request.URL.Path, time.Since(start))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user