Skip to content

Commit

Permalink
remove log verbosity and increase response verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 committed Aug 28, 2023
1 parent 8b4bdd3 commit 9d6ea64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/email-validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ async def validate(email: str):
valid = await is_valid_domain(email) and await is_valid_email(email)

if valid:
content = {"valid": True}
content = {"valid": True, "msg": "All good."}
status_code = http.HTTPStatus.OK
else:
content = {"valid": False}
content = {"valid": False, "msg": "Non-business email not allowed."}
status_code = http.HTTPStatus.BAD_REQUEST

return fastapi.responses.JSONResponse(content=content, status_code=status_code)
Expand All @@ -52,7 +52,7 @@ async def timeit(request: fastapi.Request, call_next):
start_time = time.time()
response: fastapi.Response = await call_next(request)
process_time = time.time() - start_time
logger.info(
logger.debug(
f"Request: {request.method} {request.url.path} | Response: {response.status_code} | Process Time: {process_time:.6f}s"
)
return response
Expand Down

0 comments on commit 9d6ea64

Please sign in to comment.