From 9c1b72e33ff99c593f7e0c647fa937c88e30d0cf Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Thu, 15 Mar 2018 17:14:42 -0400 Subject: [PATCH] Fix color output on Windows --- oldlog.go | 3 ++- package.json | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/oldlog.go b/oldlog.go index 6cc361e..82105de 100644 --- a/oldlog.go +++ b/oldlog.go @@ -5,6 +5,7 @@ import ( "fmt" "os" + colorable "github.com/mattn/go-colorable" logging "github.com/whyrusleeping/go-logging" ) @@ -44,7 +45,7 @@ func SetupLogging() { lfmt = LogFormats[defaultLogFormat] } - backend := logging.NewLogBackend(os.Stderr, "", 0) + backend := logging.NewLogBackend(colorable.NewColorableStderr(), "", 0) logging.SetBackend(backend) logging.SetFormatter(logging.MustStringFormatter(lfmt)) diff --git a/package.json b/package.json index a7745f1..3ff662c 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,12 @@ "hash": "QmWLWmRVSiagqP15jczsGME1qpob6HDbtbHAY2he9W5iUo", "name": "opentracing-go", "version": "0.0.3" + }, + { + "author": "mattn", + "hash": "QmVrtgFpU2Q7FmuqHuiB62BZJrAtatBAxwFSmwYQpzA1eA", + "name": "go-colorable", + "version": "0.1.0" } ], "gxVersion": "0.7.0",