cupcake/raven-go — pull request #5 by tylrtrmbl (2013-12-27 20:26:06+00:00)
Title: Add Sentry io.Writer for integration with standard logging platform

From the [client design docs](http://sentry.readthedocs.org/en/latest/developer/client/index.html):

> Additionally, the following features are highly encouraged:
>
> - Automated error handling (e.g. default error handlers)
> - __Logging integration (to whatever standard solution is available)__
> - Non-blocking event submission
> - Basic data sanitization (e.g. filtering out values that look like passwords)

Go's "standard solution" is the [log](http://golang.org/pkg/log/#New) package, which takes an [io.Writer](http://golang.org/pkg/io/#Writer). Accordingly, raven.Writer is an io.Writer that writes a standard "message" to a Sentry client at a specified logging level.

This code snippet worked for me and demo's the functionality:

w := &raven.Writer{client, raven.INFO}
l := log.New(w, "", 0)
l.Print("If you're seeing this, it's workin'!")