Skip to content

Commit

Permalink
Merge pull request #21 from djdv/fix/win-color
Browse files Browse the repository at this point in the history
Fix color output on Windows
  • Loading branch information
Stebalien authored Mar 17, 2018
2 parents 0e2a17b + 9c1b72e commit 59b4549
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion oldlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

colorable "github.com/mattn/go-colorable"
logging "github.com/whyrusleeping/go-logging"
)

Expand Down Expand Up @@ -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))

Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 59b4549

Please sign in to comment.