h3poteto / logist

A json logger for Rails
MIT License
26 stars 9 forks source link

Changed to accept StandarError object. #13

Open kazuhisa opened 4 years ago

kazuhisa commented 4 years ago

Problem.

def foo
  ...
rescue StandardError => e
  Rails.logger.error(e)
end

Error occurs when writing StandardError object to log.

TypeError: no implicit conversion of TypeError into String

I fixed StandardError and its subclass so that logger can receive it.

h3poteto commented 4 years ago

Thank you for your contribution. Your changes are good.

But I think that it's better to show not only message, but also cause, stacktrace or other StandardError properties. What dou you think?

kazuhisa commented 4 years ago

I think so too.👍 I will try to output stacktrace .