commit | 3cc8472a2a21fcdd78c18d6a718d3b0bec3f789f | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Wed Mar 22 14:10:05 2023 |
committer | GitHub <noreply@github.com> | Wed Mar 22 14:10:05 2023 |
tree | 756735ecd65e32f1a240cd358fd6540fdf82d029 | |
parent | 11a925cff3d38c293ddc8c05a16b504e3e2c63be [diff] | |
parent | 9cb611b0369c360d3342f83d3f67e1331b4f55e8 [diff] |
Merge pull request #67 from dolmen-go/ci-go1.20 CI: add Go 1.18 to 1.20
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)