https://github.com/bigcommerce/noopraven-go
A raven-go interface with a noop implementation.
https://github.com/bigcommerce/noopraven-go
Last synced: 9 months ago
JSON representation
A raven-go interface with a noop implementation.
- Host: GitHub
- URL: https://github.com/bigcommerce/noopraven-go
- Owner: bigcommerce
- License: mit
- Created: 2015-05-06T03:35:10.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-12-16T00:08:01.000Z (over 10 years ago)
- Last Synced: 2025-01-06T02:27:11.728Z (over 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 2
- Watchers: 19
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# noop-raven
[](https://travis-ci.org/bigcommerce/noopraven-go)
This is an Interface and a no-op implementation for [Raven](https://github.com/getsentry/raven-go).
This is useful if you want to drop a Raven client instance into some code without having to always check if it's enabled or not when using it.
## Installation
go get github.com/bigcommerce/noopraven-go
## Usage
Import:
import "github.com/bigcommerce/noopraven-go"
import "github.com/getsentry/raven-go"
...
var ravenClient noopraven.RavenClient
if ravenEnabled {
var err error
ravenClient, err = raven.NewClient(dsn, nil)
// ...
} else {
ravenClient = &noopraven.NoopRavenClient{}
}
// use ravenClient whether it's enabled or not
// use the noopraven.RavenClient interface type for arguments in your
// functions which expect a raven client