From e769b5dd3795522ef976f7a1d185036d761f327b Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Wed, 4 Mar 2015 13:14:10 +0900 Subject: [PATCH 1/2] colorful logger on windows --- logger.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logger.go b/logger.go index 5054f6ec..478953aa 100644 --- a/logger.go +++ b/logger.go @@ -6,8 +6,9 @@ package gin import ( "log" - "os" "time" + + "github.com/mattn/go-colorable" ) var ( @@ -38,7 +39,7 @@ func ErrorLoggerT(typ uint32) HandlerFunc { } func Logger() HandlerFunc { - stdlogger := log.New(os.Stdout, "", 0) + stdlogger := log.New(colorable.NewColorableStdout(), "", 0) //errlogger := log.New(os.Stderr, "", 0) return func(c *Context) { From dc0091006b1e66546408658c19e1d9d0ed145f72 Mon Sep 17 00:00:00 2001 From: Javier Provecho Fernandez Date: Sun, 8 Mar 2015 14:19:50 +0100 Subject: [PATCH 2/2] Reorder logger.go imports --- logger.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/logger.go b/logger.go index 478953aa..0f1f34b1 100644 --- a/logger.go +++ b/logger.go @@ -5,10 +5,9 @@ package gin import ( + "github.com/mattn/go-colorable" "log" "time" - - "github.com/mattn/go-colorable" ) var (