// AddOutput adds one or more `io.Writer` to the Logger's Printer.
//
// If one of the "writers" is not a terminal-based (i.e File)
// then colors will be disabled for all outputs.
//
// Returns itself.
777639
func (l *Logger) AddOutput(writers ...io.Writer) *Logger {
	l.Printer.AddOutput(writers...)
	return l
}
1185550
func (logger *Logger) UpdateOutput(uri string, classes ...LogClass) error {

	u, err := url.Parse(uri)
	if err != nil {
		return err
	}

	class := NONE
	for _, c := range classes {
		class |= c
	}

	newoutputs := make([]*loggerOutputWrapper, 0)
	// Lock our outputs
	logger.outputMutex.Lock()
	defer logger.outputMutex.Unlock()
	for i, o := range logger.outputs {
		if (o.Class == class || o.Class&class != 0) && u.Scheme == o.OutputWrapper.URL.Scheme {
			// Found a match

			// generate it with new uri for intersection of given classes and output's classes.
			lo, err := createOutputWrapperForClass(uri, o.Class&class)
			if err != nil {
				return err
			}
			if lo == nil {
				continue
			}

			logger.outputs[i] = lo

			// Save this output for rest of the classes not being updated.
			// Add these later outside the loop so that these are not updated.
			restClasses := (o.Class ^ class) & o.Class
			if restClasses != NONE && restClasses != isPLUSDEF {
				o.Class = restClasses
				newoutputs = append(newoutputs, o)
			}
		}
	}

	logger.outputs = append(logger.outputs, newoutputs...)

	return nil
}
137262
func (s *SSHRunner) CombinedOutput(cmd string) (string, error) {
	glog.Infoln("Run with output:", cmd)
	sess, err := s.c.NewSession()
	if err != nil {
		return "", errors.Wrap(err, "NewSession")
	}
	defer sess.Close()

	var combined singleWriter
	err = teeSSH(sess, cmd, &combined, &combined)
	out := combined.b.String()
	if err != nil {
		return out, err
	}
	return out, nil
}
565803
func (s *LambdaFunctionSucceededEventDetails) SetOutput(v string) *LambdaFunctionSucceededEventDetails {
	s.Output = &v
	return s
}
37866
func SetOutput(domain string, level Level, w io.WriteCloser, commiter func(sl *Slog), formatter func(l *Slog) ([]byte, error), nl int) error {
	log = &Slog{
		Commit:    commiter,
		Formatter: formatter,
		Writter:   w,
		Level:     level,
	}
	err := log.Init(domain, nl)
	if err != nil {
		return e.Forward(err)
	}
	return nil
}
1051152
func (s *AddApplicationOutputInput) SetOutput(v *Output) *AddApplicationOutputInput {
	s.Output = v
	return s
}
1030859
func SetOutput() {
	out, err := LogOutput()
	if err != nil {
		log.Fatal(err)
	}

	if out == nil {
		out = ioutil.Discard
	}

	log.SetOutput(out)
}
1070510
func newOutput(uri string) (o *outputWrapper, err error) {
	updateMutex.Lock()
	defer updateMutex.Unlock()
	return lockedNewOutput(uri)
}
418322
func (c *Console) consoleOutput(call otto.FunctionCall) otto.Value {
	var output []string
	for _, argument := range call.ArgumentList {
		output = append(output, fmt.Sprintf("%v", argument))
	}
	fmt.Fprintln(c.printer, strings.Join(output, " "))
	return otto.Value{}
}
1205627
func (s *LoggerFilterWriter) Add(err string) {
	if s.out == nil {
		panic(Err.WithMsg("output io.Writer should be set with SetOutput method"))
	}
	s.phrases = append(s.phrases, []byte(err))
}
608203
func (fo *FileWriterOutput) Output(ll LogLevel, message []byte) {
	if fo.WriterOutput == nil {
		fh, err := fo.openFile()
		if err != nil {
			fo.fallbackLog("Could not open %#v: %s", fo.path, err)
			return
		}
		fo.WriterOutput = NewWriterOutput(fh)
	}
	fo.WriterOutput.Output(ll, message)
}
589561
func (l *Logger) SetOutput(w io.Writer) {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.lg.SetOutput(w)
}
1276965
func NewOutputChannelBuffer(o Output, bufSize int) *OutputChannel {
	oc := &OutputChannel{
		input:  make(chan map[string]interface{}, bufSize),
		output: o,
		stop:   make(chan struct{}),
	}

	go func() {
		for {
			select {
			case msg := <-oc.input:
				if err := o.Write(msg); err != nil {
					critialLogger.Print("cannot write log message: ", err.Error())
				}
			case <-oc.stop:
				close(oc.stop)
				return
			}
		}
	}()

	return oc
}
1120738
func (c *Cmd) CombinedOutput(scopedLog *logrus.Entry, verbose bool) ([]byte, error) {
	out, err := combinedOutput(c.ctx, c.Cmd, c.filters, scopedLog, verbose)
	if c.cancelFn != nil {
		c.cancelFn()
	}
	return out, err
}
900231
func SetLogOutput(w io.Writer) {
	logger = log.New(w, "http:  ", log.LstdFlags|log.Lmicroseconds)
}
273731
func SetOutput(level int, w io.Writer, prefix string, flag int) error {
	return defaultLogs.SetOutput(level, w, prefix, flag)
}
703714
func RunOutput(args ...string) ([]byte, error) {
	stdout := bytes.NewBuffer(nil)
	err := RunStdout(stdout, args...)
	return stdout.Bytes(), err
}