// Output returns the error message if result.Error exists, otherwise returns the result.Message
556891
func (res NodeModuleResult) Output() (out string) {
	if res.Error != nil {
		out = res.Error.Error()
	} else {
		out = res.Message
	}
	return
}
590940
func (p *provisioner) Output(output string) {
	logFile := path.Join(logfileDir, p.NodeName)
	f, err := os.OpenFile(logFile, os.O_APPEND|os.O_WRONLY, 0666)
	if err != nil {
		log.Printf("Error creating logfile %s: %v", logFile, err)
		return
	}
	defer f.Close()

	// These steps are needed to remove any ANSI escape codes used to colorize
	// the output and to make sure we have proper line endings before writing
	// the string to the logfile.
	re := regexp.MustCompile(`\x1b\[[0-9;]+m`)
	output = re.ReplaceAllString(output, "")
	output = strings.Replace(output, "\r", "\n", -1)

	if _, err := f.WriteString(output); err != nil {
		log.Printf("Error writing output to logfile %s: %v", logFile, err)
	}

	if err := f.Sync(); err != nil {
		log.Printf("Error saving logfile %s to disk: %v", logFile, err)
	}
}
337699
func (cfg *cloudConfig) Output(kind OutputKind) (stdout, stderr string) {
	if out, ok := cfg.attrs["output"].(map[string]interface{}); ok {
		switch out := out[string(kind)].(type) {
		case string:
			stdout = out
		case []string:
			stdout, stderr = out[0], out[1]
		}
	}

	return stdout, stderr
}
1023774
func (self *Context) Output(item interface{}, ruleName ...string) {
	_ruleName, rule, found := self.getRule(ruleName...)
	if !found {
		logs.Log.Error("蜘蛛 %s 调用Output()时，指定的规则名不存在！", self.spider.GetName())
		return
	}
	var _item map[string]interface{}
	switch item2 := item.(type) {
	case map[int]interface{}:
		_item = self.CreatItem(item2, _ruleName)
	case request.Temp:
		for k := range item2 {
			self.spider.UpsertItemField(rule, k)
		}
		_item = item2
	case map[string]interface{}:
		for k := range item2 {
			self.spider.UpsertItemField(rule, k)
		}
		_item = item2
	}
	self.Lock()
	if self.spider.NotDefaultField {
		self.items = append(self.items, data.GetDataCell(_ruleName, _item, "", "", ""))
	} else {
		self.items = append(self.items, data.GetDataCell(_ruleName, _item, self.GetUrl(), self.GetReferer(), time.Now().Format("2006-01-02 15:04:05")))
	}
	self.Unlock()
}
341742
func Print(err error, out io.Writer) {
	switch specific := err.(type) {
	case *HereError:
		out.Write([]byte(" from: " + specific.FullLocation() + "\n"))
		Print(specific.error, out)
	case *CauseError:
		Print(specific.error, out)
		out.Write([]byte("cause: " + specific.cause.Error() + "\n"))

		if cause, ok := specific.cause.(*CauseError); ok {
			for {
				out.Write([]byte("cause: " + cause.cause.Error() + "\n"))

				if sub, ok := cause.cause.(*CauseError); ok {
					cause = sub
				} else {
					break
				}
			}
		}
	case *TraceError:
		Print(specific.error, out)
		out.Write([]byte("trace:\n" + specific.trace))

	default:
		out.Write([]byte("error: " + err.Error() + "\n"))
	}
}
1073905
func (r *Report) Error(line int, message string) {
	r.entries = append(r.entries, Entry{entryError, message, line})
}
881442
func (l *Logger) Output(lv Level, calldepth int, s string) error {
	if lv >= l.min {
		if (l.flag & Llevel) != 0 {
			return l.lg.Output(calldepth, fmt.Sprintf("[%v] %s", lv, s))
		}
		return l.lg.Output(calldepth, s)
	}
	return nil
}
950267
func (e *Error) Error() string {
	if len(e.Stderr) == 0 {
		return e.ExitError.Error()
	}
	n := bytes.IndexByte(e.Stderr, '\n')
	if n < 0 {
		return string(e.Stderr)
	}
	return string(e.Stderr[:n])
}
1110232
func (c ModuleCallInstance) Output(name string) ModuleCallOutput {
	return ModuleCallOutput{
		Call: c,
		Name: name,
	}
}
803274
func Error(v ...interface{}) {
	std.Fprint(std.flags, LEVEL_ERROR, 2, fmt.Sprint(v...), nil)
}
1211463
func (e Errors) Error() string {
	ret := ""
	if len(e) > 0 {
		ret = fmt.Sprintf("Errors:\n")
		ret += strings.Join(e, "\n")
	}
	return ret
}
1017522
func (rl Raw) Output() string {
	if i := rl.sepLoc; i > -1 {
		return rl.buf[i+1:]
	}
	return rl.buf
}
449235
func (v *Errors) Error() string {
	errs := []string{}
	for _, v := range v.Errors {
		errs = append(errs, v...)
	}
	return strings.Join(errs, "\n")
}
296039
func Error(v ...interface{}) {
	f := extractFields(&v)
	std.OutputF(LevelError, 2, fmt.Sprint(v...), f)
}
181199
func Output(w io.Writer) ServiceOption {
	return func(s *Service) error {
		s.output = w
		return nil
	}
}
979321
func (this *BatchResponse) PrintResults() {
	fmt.Println("Error       : ", this.Error)
	fmt.Println("Status      : ", this.Status)
	fmt.Println("Status Code : ", this.StatusCode)
	for i, val := range this.Results {
		if batchErrors[val["error"]] == true {
			fmt.Println("ID: ", i, " | ", val["error"])
		}
	}
}
160647
func ExecOutput(cmdline string) string {
	cmd := startCommand(cmdline)

	var out bytes.Buffer
	cmd.Stdout = &out
	err := cmd.Run()
	if err == nil {
		return out.String()
	}
	return fmt.Sprintf("Error: %s", err.Error())
}