func colorizeMessage(color, prefix, message string, args ...interface{}) string { prefResult := "" if prefix != "" { prefResult = ansi.Color(prefix, color+"+b") + " " + ansi.ColorCode("reset") } return prefResult + ansi.Color(fmt.Sprintf(message, args...), color) + ansi.ColorCode("reset") }
func (f *fullDBInfo) MaintenanceString() string { valstr, _ := f.DBInfo.Info.GetString("Maintenance") if valstr != "" && valstr != "not required" { return " " + ansi.Color("!!", "red+b") + ansi.ColorCode("reset") } return "" }
func (c *colorizer) Writeln(p string) (n int, err error) { if c.filter.MatchString(p) { submatches := c.filter.FindStringSubmatch(p) return fmt.Fprintln(c.writer, ansi.Color(submatches[1], c.resolve(submatches[2]))+ansi.ColorCode("reset")+submatches[3]) } return fmt.Fprintln(c.writer, p) }