more logging
This commit is contained in:
@@ -3,6 +3,7 @@ package providers
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -71,6 +72,18 @@ func (c *WundergroundClient) Upload(ctx context.Context, u WUUpload) (string, er
|
||||
// Optional: a software identifier
|
||||
q.Set("softwaretype", "go-weatherstation-go")
|
||||
|
||||
// Log sanitized params so it's clear what we're sending.
|
||||
safe := url.Values{}
|
||||
for k, vals := range q {
|
||||
if k == "PASSWORD" {
|
||||
continue
|
||||
}
|
||||
for _, v := range vals {
|
||||
safe.Add(k, v)
|
||||
}
|
||||
}
|
||||
log.Printf("wunderground upload params %s", safe.Encode())
|
||||
|
||||
reqURL := wuEndpoint + "?" + q.Encode()
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, reqURL, nil)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user