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")
-
Notifications
You must be signed in to change notification settings - Fork 0
kismia/logruspflag
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published