Skip to content

Commit

Permalink
Merge pull request #41 from D3Hunter/expose-errsyncer
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Dec 12, 2024
2 parents 862ccc3 + f282ef7 commit 7e3ff86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ type Config struct {

// ZapProperties records some information about zap.
type ZapProperties struct {
Core zapcore.Core
Syncer zapcore.WriteSyncer
Level zap.AtomicLevel
Core zapcore.Core
Syncer zapcore.WriteSyncer
ErrSyncer zapcore.WriteSyncer
Level zap.AtomicLevel
}

func (cfg *Config) buildOptions(errSink zapcore.WriteSyncer) []zap.Option {
Expand Down
7 changes: 4 additions & 3 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ func InitLoggerWithWriteSyncer(cfg *Config, output, errOutput zapcore.WriteSynce
opts = append(cfg.buildOptions(errOutput), opts...)
lg := zap.New(core, opts...)
r := &ZapProperties{
Core: core,
Syncer: output,
Level: level,
Core: core,
Syncer: output,
ErrSyncer: errOutput,
Level: level,
}
return lg, r, nil
}
Expand Down

0 comments on commit 7e3ff86

Please sign in to comment.