🎧 Your Personal Streaming Service
Go airsonicmadsonicmedia-servermusicmusic-servernavidromeopensubsonicraspberry-piself-hostedstreamerstreaming-apistreaming-audiosubsonicsubsonic-server
Add trace logs to calls to external services
Deluan712d8f9fcc99
diff --git a/core/agents/lastfm/client.go b/core/agents/lastfm/client.goindex d8b76d3c1..a993ddc51 100644--- a/core/agents/lastfm/client.go+++ b/core/agents/lastfm/client.go@@ -191,6 +191,7 @@ func (c *client) makeRequest(ctx context.Context, method string, params url.Valureq, _ := http.NewRequestWithContext(ctx, method, apiBaseUrl, nil)req.URL.RawQuery = params.Encode()+ log.Trace(ctx, fmt.Sprintf("Sending Last.fm %s request", req.Method), "url", req.URL)resp, err := c.hc.Do(req)if err != nil {return nil, errdiff --git a/core/agents/listenbrainz/client.go b/core/agents/listenbrainz/client.goindex 3e48462f6..8ed4d1691 100644--- a/core/agents/listenbrainz/client.go+++ b/core/agents/listenbrainz/client.go@@ -151,6 +151,7 @@ func (c *client) makeRequest(ctx context.Context, method string, endpoint stringreq.Header.Add("Authorization", fmt.Sprintf("Token %s", r.ApiKey))}+ log.Trace(ctx, fmt.Sprintf("Sending ListenBrainz %s request", req.Method), "url", req.URL)resp, err := c.hc.Do(req)if err != nil {return nil, errdiff --git a/core/agents/spotify/client.go b/core/agents/spotify/client.goindex 0ac310f69..25b1f9ede 100644--- a/core/agents/spotify/client.go+++ b/core/agents/spotify/client.go@@ -87,6 +87,7 @@ func (c *client) authorize(ctx context.Context) (string, error) {}func (c *client) makeRequest(req *http.Request, response interface{}) error {+ log.Trace(req.Context(), fmt.Sprintf("Sending Spotify %s request", req.Method), "url", req.URL)resp, err := c.hc.Do(req)if err != nil {return errdiff --git a/log/log.go b/log/log.goindex a0a9fd3c3..d20fa8e39 100644--- a/log/log.go+++ b/log/log.go@@ -37,6 +37,9 @@ var redacted = &Hook{"([^\\w]s=)[^&]+","([^\\w]p=)[^&]+","([^\\w]jwt=)[^&]+",++ // External services query params+ "([^\\w]api_key=)[\\w]+",},}