reformat logged output
This commit is contained in:
parent
c7bcf95a86
commit
8829ffe08b
@ -256,7 +256,7 @@ class StepwiseMathWPOAuth2(BaseOAuth2):
|
|||||||
def get_user_details(self, response) -> dict:
|
def get_user_details(self, response) -> dict:
|
||||||
if not self.is_valid_get_user_details_response(response):
|
if not self.is_valid_get_user_details_response(response):
|
||||||
logger.error(
|
logger.error(
|
||||||
"get_user_details() - received an invalid response object of {t}:{response} Cannot continue. Returning: {retval}".format(
|
"get_user_details() received an invalid response object of {t}:{response} Cannot continue. Returning: {retval}".format(
|
||||||
t=self.get_response_type(response),
|
t=self.get_response_type(response),
|
||||||
response=json.dumps(response, sort_keys=True, indent=4),
|
response=json.dumps(response, sort_keys=True, indent=4),
|
||||||
retval=json.dumps(self.user_details, sort_keys=True, indent=4),
|
retval=json.dumps(self.user_details, sort_keys=True, indent=4),
|
||||||
@ -287,7 +287,7 @@ class StepwiseMathWPOAuth2(BaseOAuth2):
|
|||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
if VERBOSE_LOGGING:
|
if VERBOSE_LOGGING:
|
||||||
logger.info(
|
logger.info(
|
||||||
"get_user_details() - returning {t}: {response}".format(
|
"get_user_details() returning {t}: {response}".format(
|
||||||
t=self.get_response_type(response),
|
t=self.get_response_type(response),
|
||||||
response=json.dumps(response, sort_keys=True, indent=4),
|
response=json.dumps(response, sort_keys=True, indent=4),
|
||||||
)
|
)
|
||||||
@ -299,7 +299,7 @@ class StepwiseMathWPOAuth2(BaseOAuth2):
|
|||||||
# conform to the structure of a wp-oauth dict.
|
# conform to the structure of a wp-oauth dict.
|
||||||
if not self.is_wp_oauth_response(response):
|
if not self.is_wp_oauth_response(response):
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"get_user_details() - response object of {t} is not a valid wp-oauth object: {response}. Cannot continue. returning: {retval}".format(
|
"get_user_details() response object of {t} is not a valid wp-oauth object: {response}. Cannot continue. returning: {retval}".format(
|
||||||
t=self.get_response_type(response),
|
t=self.get_response_type(response),
|
||||||
response=json.dumps(response, sort_keys=True, indent=4),
|
response=json.dumps(response, sort_keys=True, indent=4),
|
||||||
retval=json.dumps(self.user_details, sort_keys=True, indent=4),
|
retval=json.dumps(self.user_details, sort_keys=True, indent=4),
|
||||||
@ -311,7 +311,7 @@ class StepwiseMathWPOAuth2(BaseOAuth2):
|
|||||||
# expected use case #1: response object is a dict with all required keys.
|
# expected use case #1: response object is a dict with all required keys.
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
if VERBOSE_LOGGING:
|
if VERBOSE_LOGGING:
|
||||||
logger.info("get_user_details() - processing response object")
|
logger.info("get_user_details() processing response object")
|
||||||
|
|
||||||
# try to parse out the first and last names
|
# try to parse out the first and last names
|
||||||
split_name = response.get("display_name", "").split()
|
split_name = response.get("display_name", "").split()
|
||||||
@ -340,7 +340,7 @@ class StepwiseMathWPOAuth2(BaseOAuth2):
|
|||||||
}
|
}
|
||||||
if VERBOSE_LOGGING:
|
if VERBOSE_LOGGING:
|
||||||
logger.info(
|
logger.info(
|
||||||
"get_user_details() - finish. user_details: {user_details}".format(
|
"get_user_details() returning: {user_details}".format(
|
||||||
user_details=json.dumps(self.user_details, sort_keys=True, indent=4)
|
user_details=json.dumps(self.user_details, sort_keys=True, indent=4)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user