// createOutputWrapper generates a new loggerOutputWrapper based on the passed
// parameters. It will return an error if it fails to generate the output. It
// will return nil, nil if there are no classes specified.
504788
func createOutputWrapper(uri string, classes []LogClass) (*loggerOutputWrapper, error) {
	// If the caller didn't give us any classes to configure then we do
	// nothing. This can be either an error or not, and since it is just as easy
	// either way we define this as being a no op rather than error condition.
	if len(classes) == 0 {
		return nil, nil
	}

	// Combine the output classes into just one
	class := NONE
	for _, c := range classes {
		class |= c
	}

	return createOutputWrapperForClass(uri, class)
}
1188526
func NewClientWrapper() client.Wrapper {
	return func(c client.Client) client.Client {
		return &roundrobin{
			rr:     make(map[string]int),
			Client: c,
		}
	}
}
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
}
459793
func (s *SynthesisTask) SetOutputFormat(v string) *SynthesisTask {
	s.OutputFormat = &v
	return s
}
1268550
func (wi *Instance) CreateWrangler(logger logutil.Logger) *wrangler.Wrangler {
	return wrangler.New(logger, wi.topoServer, tmclient.NewTabletManagerClient())
}
212914
func NewClientWrapper(service micro.Service) client.Wrapper {
	return func(c client.Client) client.Client {
		return &clientWrapper{service, c}
	}
}
1147041
func SetOutput(out io.Writer) {
	std = New(out, std.Prefix(), std.Flags(), std.priority)
}
1070510
func newOutput(uri string) (o *outputWrapper, err error) {
	updateMutex.Lock()
	defer updateMutex.Unlock()
	return lockedNewOutput(uri)
}
305949
func (s *StorageDescriptor) SetOutputFormat(v string) *StorageDescriptor {
	s.OutputFormat = &v
	return s
}
574707
func NewInfiniteChannelWrapper() *InfiniteChannelWrapper {
	ch := &InfiniteChannelWrapper{
		InfiniteChannel: channels.NewInfiniteChannel(),
		input:           make(chan interface{}, defaultInfiniteBufferSize),
		shutdownCh:      make(chan struct{}),
	}
	go ch.run()
	return ch
}
522370
func NewWrapper(next http.Handler, name string, spanKind ext.SpanKindEnum) http.Handler {
	return &Wrapper{
		next:     next,
		name:     name,
		spanKind: spanKind,
	}
}
121763
func (s *TrainingJobDefinition) SetOutputDataConfig(v *OutputDataConfig) *TrainingJobDefinition {
	s.OutputDataConfig = v
	return s
}
1317819
func (a *API) createInputOutputShapes() {
	for _, op := range a.Operations {
		createAPIParamShape(a, op.Name, &op.InputRef, op.ExportedName+"Input",
			shamelist.Input,
		)
		createAPIParamShape(a, op.Name, &op.OutputRef, op.ExportedName+"Output",
			shamelist.Output,
		)
	}
}
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
}
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))

}
185098
func (c *Configurator) OutgoingRPCWrapper() DCWrapper {
	c.log("OutgoingRPCWrapper")
	if c.outgoingRPCTLSDisabled() {
		return nil
	}

	// Generate the wrapper based on dc
	return func(dc string, conn net.Conn) (net.Conn, error) {
		return c.wrapTLSClient(dc, conn)
	}
}
635891
func NewWrapperHandler(delegate http.Handler, handlerEnv HandlerEnv) http.Handler {
	return newWrapperHandler(delegate, handlerEnv)
}