Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ruby logger helper method for friendly logging of exceptions with stack trace.
class Logger
def exception(e, level=:error)
self.send level, "#{e.inspect} #{e.message}"
self.send level, " #{e.backtrace.first(25).join("\n ")}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.