You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been reading the section about error handling and tried to play with some mistyped keys (to see LOG15_ERROR reports), but it didn't work very well.
The problem with empty LOG15_ERROR is due to this code in logfmt:
k, ok:=ctx[i].(string)
v:=formatLogfmtValue(ctx[i+1])
if!ok {
k, v=errorKey, formatLogfmtValue(k) // oops, k is empty here!
}
I think the code tried to include key name of invalid field, but this is empty because of the failed conversion to string. One possible solution could be to include field ID in error string, i.e. something like:
v=fmt.Printf("field %d is not a string", i)
I'm happy to provide a patch once the intended behaviour is confirmed.
I've been reading the section about error handling and tried to play with some mistyped keys (to see
LOG15_ERROR
reports), but it didn't work very well.Here is the code and corresponding output:
The text was updated successfully, but these errors were encountered: