// AddDefaultOutput adds a new default output which will be used on newly
// created Loggers.
486815
func AddDefaultOutput(uri string, classes ...LogClass) error {
	// generate it
	lo, err := createOutputWrapper(uri, classes)
	if err != nil {
		return err
	}
	if lo == nil {
		return nil
	}

	// Lock the default outputs
	defaultOutputMutex.Lock()
	defer defaultOutputMutex.Unlock()
	defaultOutputs = append(defaultOutputs, lo)
	return nil
}
1127658
func DefaultInput(serverType string) Input {
	if _, ok := serverTypes[serverType]; !ok {
		return nil
	}
	if serverTypes[serverType].DefaultInput == nil {
		return nil
	}
	return serverTypes[serverType].DefaultInput()
}
565803
func (s *LambdaFunctionSucceededEventDetails) SetOutput(v string) *LambdaFunctionSucceededEventDetails {
	s.Output = &v
	return s
}
816348
func addDefaultHelpSubcommands(commands []cli.Command) {
	for i := range commands {
		cmd := &commands[i]
		if cmd.Subcommands != nil {
			cmd.Subcommands = append(cmd.Subcommands, defaultSubcommandHelp)
			addDefaultHelpSubcommands(cmd.Subcommands)
		}
	}
}
569307
func AddNewOutputFunc(name string, f NewOutputFunc) bool {
	updateMutex.Lock()
	defer updateMutex.Unlock()
	return lockedAddNewOutputFunc(name, f)
}
315178
func HookOutput(outputs []*bytes.Buffer) []byte {
	r := []byte{}
	for _, m := range outputs {
		r = append(r, m.Bytes()...)
	}
	return r
}
1070510
func newOutput(uri string) (o *outputWrapper, err error) {
	updateMutex.Lock()
	defer updateMutex.Unlock()
	return lockedNewOutput(uri)
}
589561
func (l *Logger) SetOutput(w io.Writer) {
	l.mu.Lock()
	defer l.mu.Unlock()
	l.lg.SetOutput(w)
}
1303302
func makeDefaultLogger() Logger {
	var level = debugLevel

	if val := os.Getenv("LOG_LEVEL"); val != "" {
		var levels = map[string]int{
			"debug":    debugLevel,
			"info":     infoLevel,
			"warning":  warnLevel,
			"warn":     warnLevel,
			"error":    errorLevel,
			"critical": criticalLevel,
			"fatal":    criticalLevel,
		}
		level = levels[val]
	}

	return &loggerImpl{level: level}
}
1030859
func SetOutput() {
	out, err := LogOutput()
	if err != nil {
		log.Fatal(err)
	}

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

	log.SetOutput(out)
}
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
}
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)
}
900231
func SetLogOutput(w io.Writer) {
	logger = log.New(w, "http:  ", log.LstdFlags|log.Lmicroseconds)
}
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
}
949775
func (ctx *context) PostValueIntDefault(name string, def int) int {
	if v, err := ctx.PostValueInt(name); err == nil {
		return v
	}

	return def
}