Commit Graph

8 Commits

Author SHA1 Message Date
Matt Bostock 7ba71bd357 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-19 10:03:27 -04:00
Matt Bostock 4fcb55c734 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-19 10:03:27 -04:00
Matt Bostock 31897e2db5 Remove misleading comment in Airbrake hook
As far as I can tell, exceptions are always sent regardless of what
`airbrake.Environment` is set to.
2015-03-19 10:03:27 -04:00
Matt Bostock e803eeed62 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-19 10:03:27 -04:00
Antoine Grondin e5621dca87 Export package func to a standard logger. 2014-07-21 21:19:55 -04:00
Antoine Grondin 52039d614e Checks that the `error` field is really and `error` type. 2014-07-13 14:49:59 -04:00
Simon Eskildsen b65435d801 hooks/airbrake: fix docs 2014-05-03 20:32:21 -04:00
Simon Eskildsen d4f08ce128 hooks: add airbrake hook
hooks: Add airbrake hook

examples: move around to avoid overloading main

airbarke move around

remove tex.tgo

readme: cleanup

readme: try something different
2014-04-23 19:55:11 -04:00