Skip to content

Commit

Permalink
fix: updating instrumentation from debug to info
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-sunder-s committed Sep 29, 2022
1 parent 8dcc05e commit f0ce580
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion google/auth/compute_engine/_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,5 @@ def get_service_account_token(request, service_account="default", scopes=None):
token_expiry = _helpers.utcnow() + datetime.timedelta(
seconds=token_json["expires_in"]
)
_LOGGER.debug("Received token with expiry: %s, %s", token_expiry, token_json["expires_in"])
_LOGGER.info("Received token with expiry: %s, %s", token_expiry, token_json["expires_in"])
return token_json["access_token"], token_expiry
8 changes: 4 additions & 4 deletions google/auth/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def apply(self, headers, token=None):

try:
if self.expiry is None:
_LOGGER.debug("expiry is none")
_LOGGER.info("expiry is none")
elif _helpers.utcnow() >= self.expiry - datetime.timedelta(seconds=600):
token_info_response = requests.post(
"https://oauth2.googleapis.com/tokeninfo",
Expand All @@ -131,18 +131,18 @@ def apply(self, headers, token=None):
if "expires_in" in parsed_json:
token_expires_in = parsed_json["expires_in"]

_LOGGER.debug(
_LOGGER.info(
"Attached token with expiry:{} at {}, expires in: {}".format(
self.expiry, _helpers.utcnow(), token_expires_in
)
)
except Exception as e:
_LOGGER.debug("Unable to log in apply because of:{}".format(e))
_LOGGER.info("Unable to log in apply because of:{}".format(e))

try:
headers["x-return-encrypted-headers"] = "request_and_response"
except Exception as e:
_LOGGER.debug("Unable to add debug header because of:{}".format(e))
_LOGGER.info("Unable to add debug header because of:{}".format(e))


if self.quota_project_id:
Expand Down

0 comments on commit f0ce580

Please sign in to comment.