aletrn commited on
Commit
9e39456
·
1 Parent(s): fd04648

[feat] add missing log

Browse files
Files changed (1) hide show
  1. src/main.py +4 -3
src/main.py CHANGED
@@ -59,11 +59,12 @@ def get_parsed_bbox_points(request_input: Input) -> BBoxWithPoint:
59
 
60
  @app.post("/post_test")
61
  async def post_test(request_input: Input) -> JSONResponse:
 
62
  request_body = get_parsed_bbox_points(request_input)
63
  app_logger.info(f"request_body:{request_body}.")
64
  return JSONResponse(
65
  status_code=200,
66
- content=get_parsed_bbox_points(request_input)
67
  )
68
 
69
 
@@ -112,9 +113,9 @@ def samgeo(request_input: Input):
112
  @app.exception_handler(RequestValidationError)
113
  async def request_validation_exception_handler(request: Request, exc: RequestValidationError) -> JSONResponse:
114
  app_logger.error(f"exception errors: {exc.errors()}.")
115
- app_logger.error(f"exception body: {exc.body}.")
116
  headers = request.headers.items()
117
- app_logger.error(f'request header: {dict(headers)}.' )
118
  params = request.query_params.items()
119
  app_logger.error(f'request query params: {dict(params)}.')
120
  return JSONResponse(
 
59
 
60
  @app.post("/post_test")
61
  async def post_test(request_input: Input) -> JSONResponse:
62
+ app_logger.info(f"start:{request_input}.")
63
  request_body = get_parsed_bbox_points(request_input)
64
  app_logger.info(f"request_body:{request_body}.")
65
  return JSONResponse(
66
  status_code=200,
67
+ content=request_body
68
  )
69
 
70
 
 
113
  @app.exception_handler(RequestValidationError)
114
  async def request_validation_exception_handler(request: Request, exc: RequestValidationError) -> JSONResponse:
115
  app_logger.error(f"exception errors: {exc.errors()}.")
116
+ app_logger.error(f"exception body: {exc}.")
117
  headers = request.headers.items()
118
+ app_logger.error(f"request header: {dict(headers)}.")
119
  params = request.query_params.items()
120
  app_logger.error(f'request query params: {dict(params)}.')
121
  return JSONResponse(