-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Bug | BasicLogger Panics When len(keyvals)
is 1
#857
base: master
Are you sure you want to change the base?
Conversation
It's not a bug to panic when an API contract is violated. I may merge this, but I'm undecided -- forcing a panic has allowed me to repeatedly catch problems in development when I did have a bug by not passing key/value pairs. |
I understand, but that might not seem very user friendly, if you have a feature for EXTRA fields that works with an even number of arguments, it would make sense for it to act this way even with one argument. Another idea could be to improve the error message to make it clear that the problem was that a key/value pair was not passed. |
What do you think about changing the output to indicate there is extra output, similar to fmt (i.e. a cleaned up format of the current message)? |
Let me know if you'd like to address the change and we can reopen & merge. |
Hello! Sorry for the response delay. You have already provided such output, as stated in the issued I have opened, but it does not work if I only have a keyvals length of 1. With the small change I make, a tiny check to the keyvals size, it worked as you mentioned, displaying that single value as an EXTRA - the expected behaviour I have mentioned below. |
Whoops didn't realize this was trimming only the added comma and space, I thought this was trimming an argument. My mistake for a very fast original review, no wonder I was so confused 🤦 . |
refer to issue #856