-
Notifications
You must be signed in to change notification settings - Fork 702
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 GoFlag in CommandLine #3884
Conversation
Usage/Help output
For testing/verification purposes I added Diffs:
TESTING case-1: OUTPUT WITH DEFAULT
case-2: OUTPUT WITH config: --v=4
case-3: OUTPUT WITH config: --v=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.
Awesome - very happy to see that the setting is still controlling the log level in the plugins. Thanks for the detailed examples.
Just want to make sure, you can set the log level via the CLI right? (using -v 4
or similar) I was a bit confused as to why you explicitly set the flag in the root.go
cobra.OnInitialize(initConfig) | ||
rootCmd = newRootCmd() | ||
rootCmd.SetVersionTemplate(version) | ||
setFlags(rootCmd) | ||
goflag.Set("v", "3") |
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.
Is this just for testing? Does that override the CLI flag?
Yes, you can set in the CLI, see the examples given above. |
|
Ah - the one I checked (
Ah - I see, thanks.
Nope, already approved. Land when ready :) Thanks Satya! |
I am not sure why 'ci/circleci: local_e2e_tests-1 ' is always failing. I manually triggered it a number of times and it still fails. Please let me know if this is also seen with other CI builds |
I just took a look at the past three failures and it's mostly |
cobra.OnInitialize(initConfig) | ||
rootCmd = newRootCmd() | ||
rootCmd.SetVersionTemplate(version) | ||
setFlags(rootCmd) | ||
//set initial value of verbosity | ||
goflag.Set("v", "3") |
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.
Out of curiosity, how did you come up with this default number? In other projects I work on we use verbosity level default to 2 but to be fair I've never got a definitive answer on why.
Thanks!
@migmartri , It all depends on the specific project code. In the kubeapps code, we have many logs above level 3. (using log.V(4)). We want to suppress them by default. There is no global definitive answer. |
Thanks! |
Description of the change
Adding GoFlag command-line argument to kubeapps-apis binary.
Benefits
Developers can control the verbosity (--v) of log levels.
Possible drawbacks
A bunch of more flags are listed in usage/help.
Applicable issues
Additional information
PR 3766