more logging

This commit is contained in:
2026-01-26 13:08:34 +11:00
parent 860c30870c
commit c315811ec3
2 changed files with 39 additions and 9 deletions

View File

@@ -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 {