-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add logging #1212
Add logging #1212
Conversation
bamarni
commented
Apr 17, 2018
- Add logrus as a dependency
- Add flags for verbose outputs
pkg/cmd/dcos.go
Outdated
} | ||
|
||
cmd.PersistentFlags().CountVarP(&verbose, "", "v", "verbose (-v, or -vv)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/verbose (-v, or -vv)
/verbosity (-v or -vv)
. Also, the current output -v, -- count verbose (-v, or -vv)
is not very meaningful (what does -- count
means?), is there any way we can customize it?
revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" | ||
version = "v0.0.1" | ||
revision = "a1f051bc3eba734da4772d60e2d677f47cf93ef4" | ||
version = "v0.0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing the update in this commit? Is it necessary for logrus?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this old cobra version the usage output is a bit worse : spf13/pflag#141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage of this library seems good but we're apparently gonna need our own type of flag to have a meaningful output.
Updated it, I agree the usage help output should be improved for this flag. I couldn't find a simple way to customize it yet. We can revisit this later as the flag still behaves as expected and it's only about the help output (which we are probably going to customize anyway). |
This package will be used for CLI logging. Also update existing dependencies.
A logger is introduced, the -v and -vv global flags can control its level. The -v flag sets the level to info while the -vv flag sets the level to debug.