package pkg import "go.uber.org/zap" func InitLog() *zap.Logger { config := zap.NewDevelopmentConfig() config.OutputPaths = append(config.OutputPaths, "logfile.log") logger, err := config.Build() if err != nil { panic("Error creating config: " + err.Error()) } zap.ReplaceGlobals(logger) return logger }