Last active
April 12, 2020 11:53
-
-
Save presmihaylov/51a85bbe4c0fc2f3cb0d1c85bc3dc14f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package loggerfx | |
// imports | |
// ProvideLogger to fx | |
func ProvideLogger() *zap.SugaredLogger { | |
logger, _ := zap.NewProduction() | |
slogger := logger.Sugar() | |
return slogger | |
} | |
// Module provided to fx | |
var Module = fx.Options( | |
fx.Provide(ProvideLogger), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment