Go to file
mattn 74f8ed1281
Merge pull request #72 from alexandear/fix-test-typo
Fix typo in TestNonColorableNil
2025-01-10 17:33:50 +09:00
_example gofmt 2020-01-10 10:04:12 +09:00
.github update deps 2025-01-10 17:29:27 +09:00
cmd/colorable add colorable command 2017-08-02 10:54:08 +09:00
colorable_others.go Merge colorable_appengine.go into colorable_others.go 2023-03-21 22:15:09 +01:00
colorable_test.go Fix typo in TestNonColorableNil 2024-12-09 22:01:47 +02:00
colorable_windows.go [Windows] harden system DLL loading 2025-01-09 17:03:48 -05:00
go.mod update deps 2025-01-10 17:29:27 +09:00
go.sum update deps 2025-01-10 17:29:27 +09:00
go.test.sh Enable codecov 2020-01-10 10:04:45 +09:00
LICENSE add LICENSE 2016-02-10 09:18:57 +09:00
noncolorable.go delete buf 2021-11-23 19:56:19 +09:00
README.md Migrate to GitHub actions for CI testing 2021-09-29 11:55:36 +02:00

go-colorable

Build Status Codecov GoDoc Go Report Card

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.

Too Bad!

So Good!

Usage

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.

Installation

$ go get github.com/mattn/go-colorable

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)