1 package main 2 3 import ( 4 "github.com/mattn/go-colorable" 5 "github.com/sirupsen/logrus" 6 ) 7 8 func main() { 9 logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 10 logrus.SetOutput(colorable.NewColorableStdout()) 11 12 logrus.Info("succeeded") 13 logrus.Warn("not correct") 14 logrus.Error("something error") 15 logrus.Fatal("panic") 16 } 17