package log import ( "github.com/go-logr/logr" "github.com/go-logr/zapr" "go.uber.org/zap" ) func GetZapLogger() logr.Logger { //json logging cfg := zap.NewProductionConfig() devCfg := zap.NewDevelopmentConfig() // Readable time stamp cfg.EncoderConfig.EncodeTime = devCfg.EncoderConfig.EncodeTime logger, err := cfg.Build() if err != nil { println("unable to intialize zap log") panic(err) } return zapr.NewLogger(logger) }