commit | e1bb79c8d53c38a60962ad4b8f658226cc983710 | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Tue Nov 23 14:52:42 2021 |
committer | GitHub <noreply@github.com> | Tue Nov 23 14:52:42 2021 |
tree | 2bb1b10127c637ee4824496a381bfabb12356730 | |
parent | a1c5ae58715ec68ef41ad88c36a8fcb127f326c8 [diff] | |
parent | 699629e78c125b84de27cccc6a226c93b21f8937 [diff] |
Merge pull request #63 from naoyukis/delete_buf delete buf
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)