Skip to content

Commit

Permalink
Check logic for debug environment variable in a single place
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmoguy committed Aug 25, 2024
1 parent d8d5965 commit 0e08763
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (

var (
// Set environment variable to "TRUE" to enable debug logging
debug = os.Getenv("LIBDNS_HE_DEBUG")
debug = (os.Getenv("LIBDNS_HE_DEBUG") == "TRUE")
)

// Query Google DNS for A/AAAA/TXT record for a given DNS name
Expand Down Expand Up @@ -230,7 +230,7 @@ func (p *Provider) doRequest(ctx context.Context, domain string, params map[stri

respBody := string(bodyBytes)
if err := checkResponse(u, respBody); err != nil {
if debug == "TRUE" {
if debug {
return errors.Wrapf(err,
"HE api request failed, query=%s, response=%s", query, respBody,
)
Expand Down

0 comments on commit 0e08763

Please sign in to comment.