commit | a1c5ae58715ec68ef41ad88c36a8fcb127f326c8 | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Wed Sep 29 16:03:36 2021 |
committer | GitHub <noreply@github.com> | Wed Sep 29 16:03:36 2021 |
tree | 38ef553563b0396d05a64bed255e1953b648f7ff | |
parent | 77502a542eb81f2384260b993b3b4c8e6c195207 [diff] | |
parent | f2a4b6642a375581a4cf6f9b78dba59dee412930 [diff] |
Merge pull request #62 from tklauser/fix-go-version-gh-action Use correct field to specify Go version in GitHub action
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)