Explorar o código

optimize log format

chenhaiyang %!s(int64=4) %!d(string=hai) anos
pai
achega
07fc91a2db
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      app/api/routers/bluetooth.py

+ 2 - 1
app/api/routers/bluetooth.py

@@ -13,7 +13,8 @@ router = APIRouter()
 
 @router.post('/user/{user_id}', response_model=BluetoothUserResponse)
 async def create_bluetooth_info(user_id: str, bluetooth_info: List[BluetoothCreate]):
-    logger.info(f'{user_id}: {bluetooth_info}')
+    info_list = [item.dict() for item in bluetooth_info]
+    logger.info(f'{user_id}: {info_list}')
     response = {'Result': 'success'}
 
     return response