log icon indicating copy to clipboard operation
log copied to clipboard

Use color to support colored ouput for windows

Open StarpTech opened this issue 6 years ago • 1 comments

As titled https://github.com/fatih/color

StarpTech avatar Jan 26 '18 08:01 StarpTech

Workaround:

package main
import (
   "github.com/apex/log"
   "github.com/apex/log/handlers/text"
   "github.com/mattn/go-colorable"
)
func main() {
   aa := colorable.NewColorableStdout()
   log.SetHandler(text.New(aa))
   log.Warn("bb")
}

Or:

package main
import "github.com/labstack/gommon/log"
func main() {
   log.EnableColor()
   log.Warn("bb")
}

ghost avatar Jun 23 '19 19:06 ghost