commit | 98b7b4bed94ddf728cb512b9deba257322066875 | [log] [tgz] |
---|---|---|
author | Alec The Rabbit <alec.therabbit.git@gmail.com> | Tue Sep 24 14:22:26 2019 |
committer | Alec The Rabbit <alec.therabbit.git@gmail.com> | Tue Sep 24 14:22:26 2019 |
tree | fa5b9735d24f6b80a32f059600117afe66f00eb7 | |
parent | b3ffeffaacdc3385998f6ff5ee905e7360acdec9 [diff] |
import
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.
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.
$ go get github.com/mattn/go-colorable
MIT
Yasuhiro Matsumoto (a.k.a mattn)