// SetWriter controls which writer formatted log records are written to.
// Writers, with the exception of an *os.File, need to be safe for concurrent
// use by multiple go routines.
771573
func (s *Logging) SetWriter(w io.Writer) {
	var sw zapcore.WriteSyncer
	switch t := w.(type) {
	case *os.File:
		sw = zapcore.Lock(t)
	case zapcore.WriteSyncer:
		sw = t
	default:
		sw = zapcore.AddSync(w)
	}

	s.mutex.Lock()
	s.writer = sw
	s.mutex.Unlock()
}
1310548
func (w *Producer) SetLogger(l logger, lvl LogLevel) {
	w.logGuard.Lock()
	defer w.logGuard.Unlock()

	w.logger = l
	w.logLvl = lvl
}
535113
func (w *Writer) SetSeparators(beg, end string) {
	w.e.SetSeparators(beg, end)
}
901515
func (l *LogFile) Write(b []byte) (int, error) {
	l.Lock()
	defer l.Unlock()
	return l.writer.Write(b)
}
345982
func (writer *MultiWriter) SetRetentions(retentions int64) {
	if retentions < 1 {
		return
	}

	writer.retentions = retentions
	for _, fileWriter := range writer.writers {
		fileWriter.SetRetentions(retentions)
	}
}
76772
func (w *Writer) Write(record interface{}) error {
	m, ok := record.(map[string]string)
	if ok {
		return w.writeMapString(m)
	}
	return w.writeAny(reflect.ValueOf(record))
}
160064
func (s *DescribeTaskExecutionOutput) SetBytesWritten(v int64) *DescribeTaskExecutionOutput {
	s.BytesWritten = &v
	return s
}
37858
func (l *logger) Write(p []byte) (n int, err error) {
	l.locker.Lock()
	for _, w := range l.writers {
		n, err = w.Output().Write(p)
		if err != nil {
			return
		}
	}
	l.locker.Unlock()
	return
}
830670
func (p *File) Write(level logger.Level, headerLength int, data []byte) error {
	p.mu.Lock()
	defer p.mu.Unlock()

	if p.writer == nil {
		return errNilWriter
	}
	now := time.Now()
	if !isSameDay(now, p.createdTime) {
		if err := p.rotate(now); err != nil {
			return err
		}
	}
	n, err := p.writer.Write(data)
	p.written = true
	p.currentSize += n
	if p.currentSize >= p.config.MaxSize {
		p.rotate(now)
	}
	return err
}
693238
func (r *request) setWriteOptions(q *WriteOptions) {
	if q == nil {
		return
	}
	if q.Region != "" {
		r.params.Set("region", q.Region)
	}
	if q.Namespace != "" {
		r.params.Set("namespace", q.Namespace)
	}
	if q.AuthToken != "" {
		r.token = q.AuthToken
	}
}
773133
func (s *UserPoolClientType) SetWriteAttributes(v []*string) *UserPoolClientType {
	s.WriteAttributes = v
	return s
}
922183
func (l *Logger) Writer(level LogLevel) io.Writer {
	return &writer{l: l, level: level}
}
463352
func (w *LoggoWriter) Write(p []byte) (int, error) {
	w.Logger.Logf(w.Level, "%s", p[:len(p)-1]) // omit trailing newline
	return len(p), nil
}
436082
func SetWriter(writer io.Writer) {
	oldWriter := logEnabled.writer
	logEnabled.writer = writer
	if cache, isCache := oldWriter.(*logCache); isCache {
		cache.Flush(logEnabled)
	}
}
1053443
func Writer(unit string, l kitlog.Logger) io.WriteCloser {
	l = kitlog.With(l, "unit", unit)
	pr, pw := io.Pipe()
	go func() {
		s := bufio.NewScanner(pr)
		for s.Scan() {
			l.Log("msg", s.Text())
		}
		if err := s.Err(); err != nil {
			l.Log("msg", "scanner error", "err", err)
		}
	}()
	return pw
}
402032
func (s *DescribeDBLogFilesInput) SetFileLastWritten(v int64) *DescribeDBLogFilesInput {
	s.FileLastWritten = &v
	return s
}
171791
func (s *ConfigurationRecorderStatus) SetRecording(v bool) *ConfigurationRecorderStatus {
	s.Recording = &v
	return s
}