package logger import ( "go.uber.org/zap" ) func NewLogger(debug bool) (*zap.SugaredLogger, error) { log, err := zap.NewProduction() if debug { log, err = zap.NewDevelopment() } if err != nil { return nil, err } return log.Sugar(), nil }