func (l *loggingT) getColorByte(s severity, b []byte) []byte { var c gocolorize.Colorize switch s { case warningLog: c = gocolorize.NewColor("yellow") case errorLog: c = gocolorize.NewColor("red") case fatalLog: c = gocolorize.NewColor("magenta") default: c = gocolorize.NewColor("green") } return []byte(c.Paint(string(b))) }
func ColorSuccess(message string) string { success := gocolorize.Colorize{Fg: gocolorize.Green} return success.Paint(message) }
func ColorError(message string) string { err := gocolorize.Colorize{Fg: gocolorize.Red} err.ToggleBold() return err.Paint(message) }
func ColorWarning(message string) string { warning := gocolorize.Colorize{Fg: gocolorize.Yellow} return warning.Paint(message) }
func ColorInfo(message string) string { info := gocolorize.Colorize{Fg: gocolorize.Magenta} return info.Paint(message) }
func newColorLogger(out io.Writer, severity string, color gocolorize.Color) *log.Logger { c := gocolorize.Colorize{Fg: color} return log.New(out, c.Paint("severity:"+severity)+"\t", log.Ldate|log.Ltime|log.Lshortfile) }