One color package to rule them all.

This commit is contained in:
Arturo Filastò 2018-06-29 16:50:05 +02:00
commit d8cbfd1b90
6 changed files with 28 additions and 69 deletions

View file

@ -9,17 +9,17 @@ import (
"unicode"
"unicode/utf8"
"github.com/ooni/probe-cli/internal/colors"
"github.com/fatih/color"
)
// Log outputs a log message.
func Log(msg string, v ...interface{}) {
fmt.Printf(" %s\n", colors.Purple(fmt.Sprintf(msg, v...)))
fmt.Printf(" %s\n", color.CyanString(msg, v...))
}
// Fatal error
func Fatal(err error) {
fmt.Fprintf(os.Stderr, "\n %s %s\n\n", colors.Red("Error:"), err)
fmt.Fprintf(os.Stderr, "\n %s %s\n\n", color.RedString("Error:"), err)
os.Exit(1)
}