Skip to content

Commit

Permalink
Merge pull request #18 from signalfx/improve-errors
Browse files Browse the repository at this point in the history
Improve error logging from golib
  • Loading branch information
Jay Camp authored Feb 26, 2020
2 parents 8b39f41 + 972f740 commit 4c13f7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gopkg.lock

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

9 changes: 5 additions & 4 deletions plugins/outputs/signalfx/signalfx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package signalfx

import (
"context"
"github.com/signalfx/golib/errors"
"log"

"sync"
Expand Down Expand Up @@ -162,7 +163,7 @@ outer:
buf = append(buf, dp)
if len(buf) >= s.BatchSize {
if err := s.client.AddDatapoints(s.ctx, buf); err != nil {
log.Println("E! Output [signalfx] ", err)
log.Println("E! Output [signalfx] ", errors.Details(err))
}
buf = buf[:0]
}
Expand All @@ -172,7 +173,7 @@ outer:
}
if len(buf) > 0 {
if err := s.client.AddDatapoints(s.ctx, buf); err != nil {
log.Println("E! Output [signalfx] ", err)
log.Println("E! Output [signalfx] ", errors.Details(err))
}
}
}
Expand All @@ -199,7 +200,7 @@ outer:
buf = append(buf, e)
if len(buf) >= s.BatchSize {
if err := s.client.AddEvents(s.ctx, buf); err != nil {
log.Println("E! Output [signalfx] ", err)
log.Println("E! Output [signalfx] ", errors.Details(err))
}
buf = buf[:0]
}
Expand All @@ -209,7 +210,7 @@ outer:
}
if len(buf) > 0 {
if err := s.client.AddEvents(s.ctx, buf); err != nil {
log.Println("E! Output [signalfx] ", err)
log.Println("E! Output [signalfx] ", errors.Details(err))
}
}
}
Expand Down

0 comments on commit 4c13f7f

Please sign in to comment.