Clone this repo:
  1. f1b5a0e Merge pull request #51 from zetamatta/fork2 by mattn · 3 weeks ago master
  2. ce7c9ec Fix: on Windows 8.1, ESC[7m (REVERSE) did not work. by HAYAMA_Kaoru · 3 weeks ago
  3. c10454b Merge pull request #50 from zetamatta/fork by mattn · 3 weeks ago
  4. 4b79b6e Support disable-bold,real-underline and native reverse. by HAYAMA_Kaoru · 3 weeks ago
  5. 4e32bdb Merge pull request #46 from mattn/enablecolor by mattn · 3 months 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)