Skip to content

Commit

Permalink
Upgrade to latest Airbrake notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
zefer committed Dec 2, 2016
1 parent b27d69c commit e56ab0e
Show file tree
Hide file tree
Showing 36 changed files with 1,451 additions and 388 deletions.
142 changes: 132 additions & 10 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion handlers/file_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/zefer/gompd/mpd"
"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type FileLister interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type LibraryUpdater interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/next.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"net/http"

"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type Nexter interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/pause.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"net/http"

"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type Pauser interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"net/http"

"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type Player interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/playlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"

"github.com/zefer/gompd/mpd"
"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type Playlister interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/previous.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"net/http"

"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type Previouser interface {
Expand Down
2 changes: 1 addition & 1 deletion handlers/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"net/http"

"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type Randomer interface {
Expand Down
12 changes: 9 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"

assetfs "github.com/elazarl/go-bindata-assetfs"
"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/gobrake.v1"
"gopkg.in/airbrake/glog.v2"
"gopkg.in/airbrake/gobrake.v2"

"github.com/zefer/mothership/handlers"
"github.com/zefer/mothership/mpd"
Expand All @@ -25,11 +25,17 @@ var (

func main() {
flag.Parse()
defer glog.Flush()
glog.Infof("Starting API for MPD at %s.", *mpdAddr)

if *abProjectID > int64(0) && *abApiKey != "" {
airbrake := gobrake.NewNotifier(*abProjectID, *abApiKey)
airbrake.SetContext("environment", *abEnv)
defer airbrake.Close()
defer airbrake.NotifyOnPanic()
airbrake.AddFilter(func(n *gobrake.Notice) *gobrake.Notice {
n.Context["environment"] = *abEnv
return n
})
glog.Gobrake = airbrake
}

Expand Down
2 changes: 1 addition & 1 deletion mpd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

gompd "github.com/zefer/gompd/mpd"
"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

const retryDur time.Duration = time.Second * 3
Expand Down
2 changes: 1 addition & 1 deletion mpd/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

gompd "github.com/zefer/gompd/mpd"
"gopkg.in/airbrake/glog.v1"
"gopkg.in/airbrake/glog.v2"
)

type watcher struct {
Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e56ab0e

Please sign in to comment.