Last active
April 12, 2020 11:52
-
-
Save preslavmihaylov/d6edb55b33f37bb9e3b66161d4ac10a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// ProvideLogger to fx | |
func ProvideLogger() *zap.SugaredLogger { | |
logger, _ := zap.NewProduction() | |
slogger := logger.Sugar() | |
return slogger | |
} | |
func main() { | |
fx.New( | |
configfx.Module, | |
fx.Provide(ProvideLogger), | |
... | |
).Run() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment