Normalize non-serializable values to string for JSON logger
Otherwise logger fails to work and raises the TypeError.
Example error:
TypeError: Object of type type is not JSON serializable
Looks like certain log messages passed by lava will contain the
type classes. By passing the default=str
option the JSON
sertializer will call str()
on any non-serializable value.
Example:
>>> json.dumps({"a": str})
TypeError: Object of type type is not JSON serializable
>>> json.dumps({"a": str}, default=str)
'{"a": "<class \'str\'>"}'