Skip to content
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

Level.String panics if Level == InvalidLevel #75

Open
clementauger opened this issue Oct 15, 2019 · 1 comment
Open

Level.String panics if Level == InvalidLevel #75

clementauger opened this issue Oct 15, 2019 · 1 comment

Comments

@clementauger
Copy link

hi,

the method LeveL.String panics when Level==InvalidLevel.

https://github.com/apex/log/blob/master/levels.go#L44
https://github.com/apex/log/blob/master/levels.go#L17

I suggest to add a statement before the slice access so that this pseudo value does not appear in the levelNames / levelStrings variables.

It could return an empty string or something like invalid

@tj
Copy link
Member

tj commented Oct 18, 2019

👍 sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants