Skip to content

Commit

Permalink
fix: do not undo after replace zap global
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Sep 13, 2023
1 parent 675d153 commit 07fcfc4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ func GetLogger() *zap.Logger {
}

func setZapGlobalLogger() {
undo := zap.ReplaceGlobals(logger)
defer undo()
zap.ReplaceGlobals(logger)
}

// NewContext add some fields to logger and set it to gin.Context
Expand Down

0 comments on commit 07fcfc4

Please sign in to comment.