zerolog
zerolog copied to clipboard
Add support for flag.Value to zerolog.Level
As far as I know, it would be as simple as the following (though an optional strings.ToLower
could be used for convenience):
func (l *Level) Set(val string) error {
level, err := zerolog.ParseLevel(val)
if err == nil {
*ll = level
}
return err
}
This would allow zerolog.Level to be used with flag.Var and allow people to avoid creating wrapper types to use when setting variables via flags. I just wanted to float it here to see if it would be accepted before I made a PR for it.