Skip to content

Commit

Permalink
Merge dea0a33 into 00cc7bd
Browse files Browse the repository at this point in the history
  • Loading branch information
flisky committed Mar 13, 2017
2 parents 00cc7bd + dea0a33 commit 672f3f6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func (cfg Config) Build(opts ...Option) (*Logger, error) {
}

log := New(
zapcore.NewCore(enc, sink, cfg.Level),
cfg.buildOptions(errSink)...,
zapcore.NewCore(enc, zapcore.Lock(sink), cfg.Level),
cfg.buildOptions(zapcore.Lock(errSink))...,
)
if len(opts) > 0 {
log = log.WithOptions(opts...)
Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func Fields(fs ...zapcore.Field) Option {
// safe for concurrent use.
func ErrorOutput(w zapcore.WriteSyncer) Option {
return optionFunc(func(log *Logger) {
log.errorOutput = zapcore.Lock(w)
log.errorOutput = w
})
}

Expand Down
2 changes: 1 addition & 1 deletion writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ func CombineWriteSyncers(writers ...zapcore.WriteSyncer) zapcore.WriteSyncer {
if len(writers) == 0 {
return zapcore.AddSync(ioutil.Discard)
}
return zapcore.Lock(zapcore.NewMultiWriteSyncer(writers...))
return zapcore.NewMultiWriteSyncer(writers...)
}
2 changes: 1 addition & 1 deletion zapcore/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewCore(enc Encoder, ws WriteSyncer, enab LevelEnabler) Core {
return &ioCore{
LevelEnabler: enab,
enc: enc,
out: Lock(ws),
out: ws,
}
}

Expand Down

0 comments on commit 672f3f6

Please sign in to comment.