MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / add_request_log

Method add_request_log

src/core/database.py:1498–1515  ·  view source on GitHub ↗

Add request log and return log id

(self, log: RequestLog)

Source from the content-addressed store, hash-verified

1496
1497 # Request log operations
1498 async def add_request_log(self, log: RequestLog) -> int:
1499 """Add request log and return log id"""
1500 async with self._connect(write=True) as db:
1501 cursor = await db.execute("""
1502 INSERT INTO request_logs (token_id, operation, request_body, response_body, status_code, duration, status_text, progress)
1503 VALUES (?, ?, ?, ?, ?, ?, ?, ?)
1504 """, (
1505 log.token_id,
1506 log.operation,
1507 log.request_body,
1508 log.response_body,
1509 log.status_code,
1510 log.duration,
1511 log.status_text or "",
1512 log.progress,
1513 ))
1514 await db.commit()
1515 return cursor.lastrowid
1516
1517 async def update_request_log(self, log_id: int, **kwargs):
1518 """Update an existing request log row."""

Callers 1

_log_requestMethod · 0.80

Calls 1

_connectMethod · 0.95

Tested by

no test coverage detected