Skip to content

Commit

Permalink
log: fix zap
Browse files Browse the repository at this point in the history
  • Loading branch information
labasubagia committed Sep 14, 2023
1 parent fbdf43c commit 0ac9e5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/adapter/logger/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ func (l *zapLogger) send(msg string) {
}
config.InitialFields = l.fields
logger, _ := config.Build()
defer logger.Sync()
defer func() {
logger.Sync()
l.fields = map[string]any{}
}()
stdLogger, _ := zap.NewStdLogAt(logger, l.level)
stdLogger.Println(msg)
}

0 comments on commit 0ac9e5b

Please sign in to comment.