Clone this repo:
  1. f6c0098 Merge pull request #49 from segrey/sync-access-to-console by mattn · 4 months ago master v0.1.7
  2. b6d341e synchronize access to Console (fixes #48) by Sergey Simonchik · 4 months ago
  3. f1b5a0e Merge pull request #51 from zetamatta/fork2 by mattn · 6 months ago
  4. ce7c9ec Fix: on Windows 8.1, ESC[7m (REVERSE) did not work. by HAYAMA_Kaoru · 6 months ago
  5. c10454b Merge pull request #50 from zetamatta/fork by mattn · 6 months ago

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)