Commit Graph

3 Commits

Author SHA1 Message Date
Matt Bostock 83a820d91e Rework the Airbrake hook
Rework the Airbrake hook to:

a) change the interface so that the Airbrake credentials are stored in
an unexported struct, `airbrakeHook`, which is instantiated using the
`NewHook()` method

b) send log entries where no 'error' field is set to Airbrake, using the
`entry.Message` string as the message sent to Airbrake but continue to
allow the passing of error types using the 'error' field

Update the tests accordingly, assuring that the correct message is
received by the Airbrake server.

Also update the examples in the README, which would not have worked with
the previous implementation of the Airbrake hook.
2015-03-15 16:26:24 +00:00
Matt Bostock 78dee3c0ba Rename package from logrus_airbrake to airbrake
Using underscores in package names in discouraged:
https://golang.org/doc/effective_go.html#package-names

Given that this package is in a subdirectory of the logrus package,
the name `airbrake` should be sufficiently descriptive.
2015-03-10 17:45:12 +00:00
Matt Bostock 26ea5be9c3 Add integration test to Airbrake hook
Add a test for the Airbrake hook to:

a) document how the hook is intended to work

b) test that an XML payload is received with the expected message
2015-03-06 16:18:47 +00:00