mirror of
https://github.com/labstack/echo.git
synced 2026-05-16 09:48:24 +02:00
colorful logger on windows
This commit is contained in:
@@ -6,9 +6,11 @@ import (
|
|||||||
|
|
||||||
"github.com/labstack/echo"
|
"github.com/labstack/echo"
|
||||||
"github.com/labstack/gommon/color"
|
"github.com/labstack/gommon/color"
|
||||||
|
"github.com/mattn/go-colorable"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Logger(h echo.HandlerFunc) echo.HandlerFunc {
|
func Logger(h echo.HandlerFunc) echo.HandlerFunc {
|
||||||
|
log.SetOutput(colorable.NewColorableStdout())
|
||||||
return echo.HandlerFunc(func(c *echo.Context) {
|
return echo.HandlerFunc(func(c *echo.Context) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
h(c)
|
h(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user