Clone this repo:
  1. 74f8ed1 Merge pull request #72 from alexandear/fix-test-typo by mattn · 11 days ago master
  2. 1f71342 update deps by Yasuhiro Matsumoto · 11 days ago v0.1.14
  3. 4503567 Merge pull request #73 from whereswaldon/patch-1 by mattn · 11 days ago
  4. 40e70a5 [Windows] harden system DLL loading by Chris Waldon · 11 days ago
  5. 50c5b53 Fix typo in TestNonColorableNil by Oleksandr Redko · 6 weeks ago

go-colorable

Build Status Codecov GoDoc Go Report Card

Colorable writer for windows.

For example, most of logger packages doesn‘t show colors on windows. (I know we can do it with ansicon. But I don’t want.) This package is possible to handle escape sequence for ansi color on windows.

Too Bad!

So Good!

Usage

logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
logrus.SetOutput(colorable.NewColorableStdout())

logrus.Info("succeeded")
logrus.Warn("not correct")
logrus.Error("something error")
logrus.Fatal("panic")

You can compile above code on non-windows OSs.

Installation

$ go get github.com/mattn/go-colorable

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)