crashlog/crashlog — pull request #13 by christian-schulze (2013-04-26 00:01:26+00:00)
Title: Before notify hook

Hi guys,

We have a requirement to mess with the exception and/or data of a notification before it gets sent to crashlog.io. Our Rails application runs on various servers, for example staging, uat and app. These all use the same Rails 'production' environment though, so its not easy to tell which server actually generated the error.

What do you think of a before_notify_hook which gets called within the Crashlog.notify method? An example rails/crashlog initializer would look like:-

```ruby
CrashLog.configure do |config|
config.api_key = 'my key'
config.secret = 'my secret'

config.before_notify_hook = ->(exception, data) {
data[:system][:location] = 'custom setting'
WrappedException.new('message wrapper, original message: ', exception)
}
end
```

Another option is to monkey-patch/alias the Crashlog.notify method in order to keep the hook independent of the Crashlog gem, not as elegant though.

Thoughts?