Fixes empty error object in logs (#155)
Fixes empty error object in logs (#155)

* Fixes empty error object in logs

A fix for https://github.com/lightstep/lightstep-tracer-javascript/issues/86.

When the log field is an error, we go ahead and convert it
to a normal object. Otherwise, we use json.Stringify if it's a value for
kv pair. The reason for the two different behaviors is we expect _fields
to be iterable, so converting the error to a standard object gives us that
property. If the error is a value in an object, we can safely convert it to a
JSON string.

* lint fixes

lightstephq/lightstep-tracer-javascript,lightstep/lightstep-tracer-javascript,lightstephq/lightstep-tracer-javascript,lightstep/lightstep-tracer-javascript,lightstep/lightstep-tracer-javascript,lightstephq/lightstep-tracer-javascript