Clone this repo:
  1. 1364891 Merge pull request #85 from AdamMagued/fix/issue-47-crash-vagrant-ssh-windows by mattn · 6 days ago master
  2. 22a1350 fix(colorable_windows): guard console screen buffer info lookup when handle is redirected by AdamMagued · 6 weeks ago
  3. 56c5db5 Merge pull request #84 from mattn/opt-windows-combined by mattn · 7 weeks ago v0.1.16
  4. 4844283 Integrate independently validated Windows performance improvements by Yasuhiro Matsumoto · 7 weeks ago opt-windows-combined
  5. 8bf39a2 Merge pull request #78 from mattn/windows-write-fastpath by mattn · 6 months ago v0.1.15

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)