Esempio n. 1
0
// directOutput -
func directOutput(ui cli.Ui, channel, prefix, line string) {

	channelType := strings.ToUpper(channel)
	if ui == nil {
		fmt.Printf("%s%s", prefix, line)
	} else {
		switch channelType {
		case "ERROR":
			ui.Error(fmt.Sprintf("%s%s", prefix, line))
		case "INFO":
			ui.Info(fmt.Sprintf("%s%s", prefix, line))
		case "WARN":
			ui.Warn(fmt.Sprintf("%s%s", prefix, line))
		default:
			ui.Output(fmt.Sprintf("%s%s", prefix, line))
		}
	}
}