When trying to use package go-dito/log to log a value whose type is an struct type, the function buildOtelAttributes panics. This occurs beacause this function is trying to do a type assertion with a value that is not a string. In case it is not the intended behavior, maybe we can fix that by replacing this type assertion with a call to fmt.Sprintf, using the verb %+v. This way, string type attributes will still work and struct type attributes will be used as its default string representation (if that rerepresentation is not sufficient, one can override it, defining a String() method, since the %v check if type implements the Stringer interface)
When trying to use package go-dito/log to log a value whose type is an struct type, the function
buildOtelAttributes
panics. This occurs beacause this function is trying to do a type assertion with a value that is not a string. In case it is not the intended behavior, maybe we can fix that by replacing this type assertion with a call tofmt.Sprintf
, using the verb%+v
. This way, string type attributes will still work and struct type attributes will be used as its default string representation (if that rerepresentation is not sufficient, one can override it, defining a String() method, since the%v
check if type implements the Stringer interface)