Skip to content

Commit

Permalink
Sentry log in dev mode should be error log
Browse files Browse the repository at this point in the history
  • Loading branch information
xyh committed Jan 16, 2018
1 parent 63889ca commit 3897eb6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sentry/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package sentry

import (
"fmt"
"strings"

"github.com/getsentry/raven-go"
"github.com/lingmiaotech/tonic/configs"
"github.com/lingmiaotech/tonic/logging"
"strings"
)

type Sender interface {
Expand Down Expand Up @@ -51,15 +52,15 @@ func InitSentry() (err error) {

func (s *DefaultSender) CaptureError(err error, params map[string]interface{}) {
if !s.Enabled {
logging.GetDefaultLogger().Infof("[SENTRY] error=%s , params=%v\n", err, printParams(params))
logging.GetDefaultLogger().Errorf("[SENTRY] error=%s , params=%v\n", err, printParams(params))
return
}
s.Client.CaptureError(err, nil, Extra{params})
}

func (s *DefaultSender) CaptureMessage(msg string, params map[string]interface{}) {
if !s.Enabled {
logging.GetDefaultLogger().Infof("[SENTRY] error=%s, params=%v\n", msg, printParams(params))
logging.GetDefaultLogger().Errorf("[SENTRY] error=%s, params=%v\n", msg, printParams(params))
return
}
s.Client.CaptureMessage(msg, nil, Extra{params})
Expand Down

0 comments on commit 3897eb6

Please sign in to comment.