commit | a951b9d8490994b6a2aec894a9b8bc522cf6ea42 | [log] [tgz] |
---|---|---|
author | HAYAMA_Kaoru <iyahaya@nifty.com> | Sun Jul 31 18:34:56 2016 |
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | Sun Jul 31 23:50:58 2016 |
tree | e1da83bed33cba6d7cd5e755a7df7527eded9c87 | |
parent | 6cea104aa68c848b93be9d9c4be622350c132d61 [diff] |
Let m & n for ESC[nG & ESC[m;nH start with 1 (not 0)
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)