commit | eed7f88f41dc7ac6175154e7438de5af4b3c258e | [log] [tgz] |
---|---|---|
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | Sat Mar 04 14:43:01 2017 |
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | Sat Mar 04 14:43:01 2017 |
tree | 59596952788f7283567c93fbf7ffc5581324426b | |
parent | e5d7412aa74d5e993b8e6d999329e99f507697fa [diff] |
add some tests
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)