kinbiko / bugsnag

Well-documented, maintainable, idiomatic, opinionated, and *unofficial* rewrite of the Bugsnag Go notifier
MIT License
3 stars 0 forks source link

Api on notifier #22

Closed kinbiko closed 4 years ago

kinbiko commented 4 years ago

Pulls out the With* methods, and a couple of others to the Notifier type.

Advantages to this approach

Disadvantages to this approach

Notably not included in this, is deleting the package-level Wrap function. The reasoning here is that in a service-organised application, context information would most likely be attached at the method (≠function) level, before calling into other service methods, propagating the context. Errors on the other hand may occur at any level, and being able to call Wrap in a package level ('static') function without forcing the users to pass the notifier around everywhere is worth it in order to get the lowest possible stackframes. Context data, on the other hand, are most likely identical higher up the stack, and the error can be notified/re-wrapped at this point.