示例#1
0
func TestRemove(t *testing.T) {
	tmpHome := createTmpHome()
	fakeUpdate(tmpHome)

	Fetch("kitchensink", "", tmpHome)

	var output bytes.Buffer
	log.Stderr = &output

	Remove("kitchensink", tmpHome)

	expected := pretty.Colorize("{{.Green}}--->{{.Default}} ") + "All clear! You have successfully removed kitchensink from your workspace.\n"

	expect(t, output.String(), expected)

	// reset log
	log.Stdout = os.Stdout
}
示例#2
0
文件: log.go 项目: deis/pkg
func addColor(str string, color Color) string {
	return prettyprint.Colorize(fmt.Sprintf("%s%s%s", color.String(), str, Default.String()))
}
示例#3
0
func die(err error) {
	m := "{{.Red}}[BOO!]{{.Default}} " + err.Error()
	fmt.Println(pretty.Colorize(m))
	os.Exit(1)
}
示例#4
0
func ftw(msg string, args ...interface{}) {
	t := fmt.Sprintf(msg, args...)
	m := "{{.Green}}[YAY!]{{.Default}} " + t
	fmt.Println(pretty.Colorize(m))
}
示例#5
0
func info(msg string, args ...interface{}) {
	t := fmt.Sprintf(msg, args...)
	m := "{{.Yellow}}[INFO]{{.Default}} " + t
	fmt.Println(pretty.Colorize(m))
}
示例#6
0
文件: log.go 项目: fabric8io/helm
// Warn prints a yellow-tinted warning message.
func Warn(format string, v ...interface{}) {
	fmt.Fprint(Stderr, pretty.Colorize("{{.Yellow}}[WARN]{{.Default}} "))
	Msg(format, v...)
}
示例#7
0
文件: log.go 项目: fabric8io/helm
// Debug prints a cyan-tinted message if IsDebugging is true.
func Debug(msg string, v ...interface{}) {
	if IsDebugging {
		fmt.Fprint(Stderr, pretty.Colorize("{{.Cyan}}[DEBUG]{{.Default}} "))
		Msg(msg, v...)
	}
}
示例#8
0
文件: log.go 项目: fabric8io/helm
// Info prints a green-tinted message.
func Info(format string, v ...interface{}) {
	fmt.Fprint(Stderr, pretty.Colorize("{{.Green}}--->{{.Default}} "))
	fmt.Fprintf(Stderr, appendNewLine(format), v...)
}
示例#9
0
文件: log.go 项目: fabric8io/helm
// Err prints an error message. It does not cause an exit.
func Err(format string, v ...interface{}) {
	fmt.Fprint(Stderr, pretty.Colorize("{{.Red}}[ERROR]{{.Default}} "))
	fmt.Fprintf(Stderr, appendNewLine(format), v...)
}
示例#10
0
文件: log.go 项目: fabric8io/helm
// New creates a *log.Logger that writes to this source.
func New() *log.Logger {
	ll := log.New(Stdout, pretty.Colorize("{{.Yellow}}--->{{.Default}} "), 0)
	return ll
}
示例#11
0
文件: log.go 项目: michelleN/helm
// Warn prints a yellow-tinted warning message.
func Warn(format string, v ...interface{}) {
	fmt.Fprint(Stderr, pretty.Colorize("{{.Yellow}}[WARN]{{.Default}} "))
	fmt.Fprintf(Stderr, appendNewLine(format), v...)
}
示例#12
0
文件: log.go 项目: michelleN/helm
// Debug prints a cyan-tinted message if IsDebugging is true.
func Debug(format string, v ...interface{}) {
	if IsDebugging {
		fmt.Fprint(Stderr, pretty.Colorize("{{.Cyan}}[DEBUG]{{.Default}} "))
		fmt.Fprintf(Stderr, appendNewLine(format), v...)
	}
}