-
Notifications
You must be signed in to change notification settings - Fork 324
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 -log-level flag to controller #348
Conversation
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.
🦊
subcommand/controller/command.go
Outdated
@@ -231,6 +255,24 @@ func (c *Command) Run(args []string) int { | |||
return 0 | |||
} | |||
|
|||
// toLevel returns the zapcore level and an error if lvl is not supported. | |||
func toLevel(lvl string) (zapcore.Level, error) { |
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.
You could also use the UnmarshalText
function from the zapcore
library. Not sure if you saw it and decided not to use it for some reason. The only difference between theirs and your implementation is that theirs also accepts an all-caps string for log level, but I don't think it would be bad if we do too. WDYT?
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.
💯
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 switched to using their constants. The one maybe issue is that they actually support more levels than we've documented but... probably okay?
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! Yeah, I think that's fine, given that we might switch it out to hclog.
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.
🎉
Apply license until success
No description provided.