logLevel := logrus.InfoLevel
cmd := &cobra.Command{
Use: "my-command",
RunE: func(cmd *cobra.Command, args []string) error {
logrus.SetLevel(logLevel)
return cmd.Usage()
},
}
logruspflag.LevelVar(cmd.Flags(), &logLevel, "log-level", logLevel, "Log level")