// NewOutput opens the given pin number for writing. The number provided should be the pin number known by the kernel
// NewOutput also needs to know whether the pin should be initialized high (true) or low (false)
512884
func NewOutput(p uint, initHigh bool) Pin {
	pin := Pin{
		Number: p,
	}
	exportGPIO(pin)
	time.Sleep(10 * time.Millisecond)
	initVal := uint(0)
	if initHigh {
		initVal = uint(1)
	}
	pin.direction = outDirection
	setDirection(pin, outDirection, initVal)
	pin = openPin(pin, true)
	return pin
}
26749
func New(ctx context.Context, c Config) output.Output {
	o := pubSubOutput{
		Config: &c,
	}
	o.bufferPool.New = func() interface{} { return &buffer{} }

	if c.Track {
		o.et = &output.EntryTracker{}
	}

	o.Context = log.SetField(ctx, "pubsub", &o)
	return &o
}
334387
func (logger *Logger) ResetOutput() {
	logger.outputMutex.Lock()
	logger.outputs = make([]*loggerOutputWrapper, 0)
	logger.outputMutex.Unlock()
}
921812
func (c *ContainerIO) AddOutput(name string, stdout, stderr io.WriteCloser) (io.WriteCloser, io.WriteCloser) {
	var oldStdout, oldStderr io.WriteCloser
	if stdout != nil {
		key := streamKey(c.id, name, Stdout)
		oldStdout = c.stdoutGroup.Get(key)
		c.stdoutGroup.Add(key, stdout)
	}
	if stderr != nil {
		key := streamKey(c.id, name, Stderr)
		oldStderr = c.stderrGroup.Get(key)
		c.stderrGroup.Add(key, stderr)
	}
	return oldStdout, oldStderr
}
1083779
func New() (c *Color) {
	c = new(Color)
	c.SetOutput(colorable.NewColorableStdout())
	return
}
972469
func (s *CreateStreamProcessorInput) SetOutput(v *StreamProcessorOutput) *CreateStreamProcessorInput {
	s.Output = v
	return s
}
523027
func (s *SendTaskSuccessInput) SetOutput(v string) *SendTaskSuccessInput {
	s.Output = &v
	return s
}
824500
func newOutputLogger(loggerToBufferFunc func(*logutilpb.Event)) logutil.Logger {
	return logutil.NewCallbackLogger(func(e *logutilpb.Event) {
		loggerToBufferFunc(e)
	})
}
589561
func (l *Logger) SetOutput(w io.Writer) {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.lg.SetOutput(w)
}
315178
func HookOutput(outputs []*bytes.Buffer) []byte {
	r := []byte{}
	for _, m := range outputs {
		r = append(r, m.Bytes()...)
	}
	return r
}
716381
func (logger *Logger) SetOutput(out io.Writer) {
	unsafeStd := (*unsafe.Pointer)(unsafe.Pointer(&logger.std))
	old := logger.std
	logger.std.Out = out
	atomic.CompareAndSwapPointer(unsafeStd, unsafe.Pointer(old), unsafe.Pointer(logger.std))

}
270065
func NewProgressOutput(out io.Writer) progress.Output {
	return &progressOutput{sf: &rawProgressFormatter{}, out: out, newLines: true}
}
905325
func (s *CommandPlugin) SetOutput(v string) *CommandPlugin {
	s.Output = &v
	return s
}
993768
func (l *Logger) SetOutput(output io.Writer) {
	l.fLogger.setOutput(output)
}
427475
func (s *TaskSubmittedEventDetails) SetOutput(v string) *TaskSubmittedEventDetails {
	s.Output = &v
	return s
}
565803
func (s *LambdaFunctionSucceededEventDetails) SetOutput(v string) *LambdaFunctionSucceededEventDetails {
	s.Output = &v
	return s
}
1218989
func newOutputFuncFile(u *url.URL) (Output, error) {
	if u.User != nil {
		return nil, fmt.Errorf("Can not use a username with file.")
	}
	if u.Host != "" {
		return nil, fmt.Errorf("Can not use a hostname with file.")
	}
	if u.Path == "" {
		return nil, fmt.Errorf("File output must have a path specified.")
	}
	if u.Fragment != "" {
		return nil, fmt.Errorf("Can not use a fragment with file.")
	}

	// Parse the RawQuery so we can extract the format string.
	values, err := url.ParseQuery(u.RawQuery)
	if err != nil {
		return nil, err
	}

	// Get the values we need for setting up the Output object.
	format := values.Get("format")
	delete(values, "format")
	color := values.Get("color")
	delete(values, "color")

	// Check that nothing else was defined.
	if len(values) != 0 {
		bad := make([]string, 0, len(values))
		for k, _ := range values {
			bad = append(bad, k)
		}
		return nil, fmt.Errorf("Unknown parameters: %s", strings.Join(bad, ","))
	}

	// Open the specified file
	file, err := os.OpenFile(uriPathToFilename(u.Path), os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
	if err != nil {
		return nil, err
	}

	// The output object we will return.
	return NewIOWriterOutput(file, format, color)
}