From e69cf3942e003812fc1b7e0b517ef703a6401ccd Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Sun, 14 Sep 2014 22:36:30 +0200 Subject: [PATCH] Increased logging for Last.FM requests --- headphones/lastfm.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/headphones/lastfm.py b/headphones/lastfm.py index fdb456b3..bb752e96 100644 --- a/headphones/lastfm.py +++ b/headphones/lastfm.py @@ -30,8 +30,8 @@ def request_lastfm(method, **kwargs): Call a Last.FM API method. Automatically sets the method and API key. Method will return the result if no error occured. - By default, this method will request the JSON format, since it is lighter - than XML. + By default, this method will request the JSON format, since it is more + lightweight than XML. """ # Prepare request @@ -41,6 +41,8 @@ def request_lastfm(method, **kwargs): # Send request logger.debug("Calling Last.FM method: %s", method) + logger.debug("Last.FM call parameters: %s", kwargs) + data = request.request_json(ENTRY_POINT, timeout=TIMEOUT, params=kwargs) # Parse response and check for errors. @@ -49,7 +51,7 @@ def request_lastfm(method, **kwargs): return if "error" in data: - logger.debug("Last.FM returned an error: %s", data["message"]) + logger.error("Last.FM returned an error: %s", data["message"]) return return data