1
0
mirror of https://github.com/strongdm/comply synced 2024-06-30 22:14:22 +00:00
comply/vendor/github.com/mattn/go-colorable
2021-10-06 14:33:14 -03:00
..
colorable_appengine.go Update go.mod and adjust pandoc and watch usability (#64) 2021-10-06 14:33:14 -03:00
colorable_others.go Update go.mod and adjust pandoc and watch usability (#64) 2021-10-06 14:33:14 -03:00
colorable_windows.go Update go.mod and adjust pandoc and watch usability (#64) 2021-10-06 14:33:14 -03:00
go.test.sh go.mod: update gitlab dep to v0.30.1 2020-09-14 11:31:56 -07:00
LICENSE Initial commit 2018-05-15 14:13:11 -07:00
noncolorable.go Update go.mod and adjust pandoc and watch usability (#64) 2021-10-06 14:33:14 -03:00
README.md Update go.mod and adjust pandoc and watch usability (#64) 2021-10-06 14:33:14 -03:00

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)