Sfoglia il codice sorgente

optimize log format

chenhaiyang 4 anni fa
parent
commit
07fc91a2db
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  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