module Lumberjack::DataDogDevice::ExceptionHash

Protected Instance Methods

exception_hash(exception, device) click to toggle source
# File lib/lumberjack_data_dog_device.rb, line 16
def exception_hash(exception, device)
  hash = {"kind" => exception.class.name}
  hash["message"] = exception.message unless exception.message.nil?
  trace = exception.backtrace
  if trace && device && device.respond_to?(:backtrace_cleaner) && device.backtrace_cleaner
    trace = device.backtrace_cleaner.call(trace)
  end
  hash["trace"] = trace if trace
  hash
end