mirror of https://github.com/gin-gonic/gin.git
Enables colored tag for http method in gin.Logger()
This commit is contained in:
parent
e10ed9482d
commit
b4a6510edf
|
@ -92,12 +92,12 @@ func Logger() HandlerFunc {
|
||||||
}
|
}
|
||||||
end := time.Now()
|
end := time.Now()
|
||||||
latency := end.Sub(start)
|
latency := end.Sub(start)
|
||||||
stdlogger.Printf("[GIN] %v |%s %3d %s| %12v | %s |%s %-7s %s| %s\n%s",
|
stdlogger.Printf("[GIN] %v |%s %3d %s| %12v | %s |%s %s %-7s %s\n%s",
|
||||||
end.Format("2006/01/02 - 15:04:05"),
|
end.Format("2006/01/02 - 15:04:05"),
|
||||||
color, code, reset,
|
color, code, reset,
|
||||||
latency,
|
latency,
|
||||||
requester,
|
requester,
|
||||||
methodColor, method, reset,
|
methodColor, reset, method,
|
||||||
c.Request.URL.Path,
|
c.Request.URL.Path,
|
||||||
c.Errors.String(),
|
c.Errors.String(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue