Skip to content

Commit

Permalink
Merge pull request #3 from maier/master
Browse files Browse the repository at this point in the history
v0.5.3
  • Loading branch information
maier authored Nov 28, 2018
2 parents 1613a96 + 08a4181 commit e8c5a73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.5.3

* upd: use std log for retryablehttp until dependency releases Logger interface

# v0.5.2

* upd: support any logging package with a `Printf` method via `Logger` interface rather than forcing `log.Logger` from standard log package
Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func New(ac *Config) (*API, error) {
a.Debug = ac.Debug
a.Log = ac.Log
if a.Debug && a.Log == nil {
a.Log = log.New(os.Stderr, "", log.LstdFlags)
a.Log = log.New(os.Stdout, "", log.LstdFlags)
}
if a.Log == nil {
a.Log = log.New(ioutil.Discard, "", log.LstdFlags)
Expand Down Expand Up @@ -380,7 +380,9 @@ func (a *API) apiCall(reqMethod string, reqPath string, data []byte) ([]byte, er

// retryablehttp only groks log or no log
if a.Debug {
client.Logger = a.Log.(*log.Logger)
// uncomment below when Logger interface hits retryablehttp release
// client.Logger = a.Log
client.Logger = log.New(os.Stdout, "", log.LstdFlags)
} else {
client.Logger = log.New(ioutil.Discard, "", log.LstdFlags)
}
Expand Down

0 comments on commit e8c5a73

Please sign in to comment.