New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hooks: add airbrake hook #17
Conversation
Oops, typoed @aybabtme |
Hey, just saw that. I'll have a look tomorrow. |
👍 |
Did you guys have an idea on how to move this out of the main install so not everyone has to install the Airbrake library for example? |
The first solution I can see is build tags aibrake_hook.go // +build airbrake
package logrus
[...] Then
|
I didn't know about build tags, that's cool! I might go ahead with that :-) |
Why not make the airbrake hook a separate package? It seems odd to be baked into the library. |
Like, move it into some folder (or another repo of common hooks, or where ever else not in the same namespace):
Then: log := logrus.New()
log.Hooks.Add(airbrake.Hook(...)) On a side note, I dislike build tags. |
I think I prefer @aybabtme solution (Even if I've personnaly given the other one ;-) ) It's cleaner to separate things and more than that, using build tags is a bit annoying, when you take a golang project, usually you want to "go get" it, and nothing else. I event would have done something like having a hooks directory in which you put other packages like airbrake, rollbar, or sentry. Managing another repository for each hooks can look "heavy" but it's what's happening with different projects (example https://github.com/martini-contrib) |
Yeah, a different repo with subfolders sounds good to me. I like that separation of concerns. I dislike having a repo for each one of them. I'll go ahead with that :-) |
👍 |
It's in the logrus-hooks repo, I'll update the readme laters |
hooks: Add airbrake hook examples: move around to avoid overloading main airbarke move around remove tex.tgo readme: cleanup readme: try something different
This adds an Airbrake default hook. I would've liked to have put this in its own directory inside
logrus
, but I'm getting a cycle dependency warning. It sucks if everyone has to install the Airbrake library because of this..@snormore @burke @aybatme can you guys take a look?