commit | 586e6dcca296d085100876beb6dbf02287a247f7 | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Fri Dec 29 09:55:07 2017 |
committer | GitHub <noreply@github.com> | Fri Dec 29 09:55:07 2017 |
tree | 80014a1402d53675cf5d9199f29c958f21f21f1a | |
parent | 6fcc0c1fd9b620311d821b106a400b35dc95c497 [diff] | |
parent | f644fae442e321d62c661d14bf6afc4254fac940 [diff] |
Merge pull request #30 from zetamatta/fork When the width of the screen is too large, garbage appears the screen after ESC[2J and some scrooling
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)