From b4a6510edff7d580da9e0d1aed85352969d546d5 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Sat, 13 Sep 2014 15:51:29 +0200 Subject: [PATCH] Enables colored tag for http method in gin.Logger() --- logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index 4a95f66c..5292ab8a 100644 --- a/logger.go +++ b/logger.go @@ -92,12 +92,12 @@ func Logger() HandlerFunc { } end := time.Now() 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"), color, code, reset, latency, requester, - methodColor, method, reset, + methodColor, reset, method, c.Request.URL.Path, c.Errors.String(), )