-
Notifications
You must be signed in to change notification settings - Fork 118
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 a custom log formatter #1266
Conversation
It just keeps the log entry message and appends a newline to it. This makes them more user-friendly in the terminal. Before: INFO[0000] Log message. After: Log message. https://jira.mesosphere.com/browse/DCOS_OSS-3746
Only dump requests/responses when the logging level is set to debug.
pkg/cmd/dcos.go
Outdated
@@ -19,7 +19,8 @@ const annotationUsageOptions string = "usage_options" | |||
func NewDCOSCommand(ctx api.Context) *cobra.Command { | |||
var verbose int | |||
cmd := &cobra.Command{ | |||
Use: "dcos", | |||
Use: "dcos", | |||
SilenceUsage: true, |
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.
Doesn't this silence the custom usage info that you defined in a different PR?
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.
It was silenced on invalid usage sometimes, adding it in the persistentPreRun hook seems better, cf. spf13/cobra#340
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.
I also re-added the field in the plugin commands, as it was unrealted and I'm not sure if it'd break things on this side.
This causes command help messages to appear everytime an error is triggered.
It just keeps the log entry message and appends a newline to it. This makes them more user-friendly in the terminal.
Before :
After :
https://jira.mesosphere.com/browse/DCOS_OSS-3746