Skip to content

Commit

Permalink
use logger
Browse files Browse the repository at this point in the history
  • Loading branch information
tihuan committed Dec 23, 2024
1 parent 8f1bcd8 commit d81ca4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/common/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,17 @@ def gene_info_get(request):
# DEBUG
# DEBUG
# DEBUG
print("################################################# 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎 OK")
print(f"Response content: {response.content}")
current_app.logger.info("😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎 OK")
current_app.logger.info(f"Response content: {response.content}")

return make_response(response.content, HTTPStatus.OK, {"Content-Type": "application/json"})
else:
# in the event of a failed search, return empty response
# DEBUG
# DEBUG
# DEBUG
print(f"Error: Received status code {response.status_code} from API")
print(f"Response content: {response.text}")
current_app.logger.error(f"Error: Received status code {response.status_code} from API")
current_app.logger.error(f"Response content: {response.text}")
return None
except Exception as e:
return abort_and_log(HTTPStatus.BAD_REQUEST, str(e), include_exc_info=True)
Expand Down

0 comments on commit d81ca4c

Please sign in to comment.