minio/vendor/github.com/mattn/go-colorable
Harshavardhana 35d438e0ff vendorize: update all vendorized packages. (#2206)
Bring in new changes from upstream for all the packages.

Important ones include
   - gorilla/mux
   - logrus
   - jwt
2016-07-14 14:59:20 -07:00
..
colorable_others.go vendor: Update to new upstream changes from fatih/color 2016-02-23 15:01:17 -08:00
colorable_windows.go vendorize: update all vendorized packages. (#2206) 2016-07-14 14:59:20 -07:00
LICENSE vendor: Update to new upstream changes from fatih/color 2016-02-23 15:01:17 -08:00
noncolorable.go vendorize: update all vendorized packages. (#2206) 2016-07-14 14:59:20 -07:00
README.md vendor: Update to new upstream changes from fatih/color 2016-02-23 15:01:17 -08:00

go-colorable

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)