CombineWriteSyncers is a utility that combines multiple WriteSyncers into a single, locked WriteSyncer. If no inputs are supplied, it returns a no-op WriteSyncer. It's provided purely as a convenience; the result is no different from using zapcore.NewMultiWriteSyncer and zapcore.Lock individually.
(writers ...zapcore.WriteSyncer)
| 91 | // It's provided purely as a convenience; the result is no different from |
| 92 | // using zapcore.NewMultiWriteSyncer and zapcore.Lock individually. |
| 93 | func CombineWriteSyncers(writers ...zapcore.WriteSyncer) zapcore.WriteSyncer { |
| 94 | if len(writers) == 0 { |
| 95 | return zapcore.AddSync(io.Discard) |
| 96 | } |
| 97 | return zapcore.Lock(zapcore.NewMultiWriteSyncer(writers...)) |
| 98 | } |