Updated logging levels

This commit is contained in:
Niccolò Zapponi 2020-11-05 08:33:12 +00:00
parent fc833555ac
commit 8f1bd9473a
No known key found for this signature in database
GPG key ID: 328B304DC670A51E

View file

@ -264,17 +264,17 @@ class PyiCloudService(object):
login_successful = False login_successful = False
if self.session_data.get("session_token"): if self.session_data.get("session_token"):
LOGGER.info("Checking session token validity") LOGGER.debug("Checking session token validity")
try: try:
req = self.session.post(f"{self.SETUP_ENDPOINT}/validate", data="null") req = self.session.post(f"{self.SETUP_ENDPOINT}/validate", data="null")
LOGGER.info("Session token is still valid") LOGGER.debug("Session token is still valid")
self.data = req.json() self.data = req.json()
login_successful = True login_successful = True
except PyiCloudAPIResponseException: except PyiCloudAPIResponseException:
msg = "Invalid authentication token, will log in from scratch." LOGGER.debug("Invalid authentication token, will log in from scratch.")
if not login_successful: if not login_successful:
LOGGER.info("Authenticating as %s", self.user["accountName"]) LOGGER.debug("Authenticating as %s", self.user["accountName"])
data = dict(self.user) data = dict(self.user)
@ -306,7 +306,7 @@ class PyiCloudService(object):
self._webservices = self.data["webservices"] self._webservices = self.data["webservices"]
LOGGER.info("Authentication completed successfully") LOGGER.debug("Authentication completed successfully")
def _authenticate_with_token(self): def _authenticate_with_token(self):
"""Authenticate using session token.""" """Authenticate using session token."""