MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_log_mcp_request

Function cbm_log_mcp_request

src/foundation/log.c:331–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void cbm_log_mcp_request(const char *method, const char *tool_name, bool is_error,
332 int64_t duration_us) {
333 char duration_ms[CBM_SZ_32];
334 snprintf(duration_ms, sizeof(duration_ms), "%" PRId64, duration_us / 1000);
335 if (tool_name && tool_name[0] != '\0') {
336 cbm_log(is_error ? CBM_LOG_WARN : CBM_LOG_INFO, "mcp.request", "protocol", "jsonrpc",
337 "method", method ? method : "", "tool", tool_name, "status",
338 is_error ? "error" : "ok", "duration_ms", duration_ms, NULL);
339 } else {
340 cbm_log(is_error ? CBM_LOG_WARN : CBM_LOG_INFO, "mcp.request", "protocol", "jsonrpc",
341 "method", method ? method : "", "status", is_error ? "error" : "ok", "duration_ms",
342 duration_ms, NULL);
343 }
344}
345
346void cbm_log_http_request(const char *component, const char *method, const char *path, int status,
347 int64_t duration_ms, size_t request_bytes, size_t response_bytes) {

Callers 2

cbm_mcp_server_handleFunction · 0.85
test_log.cFile · 0.85

Calls 1

cbm_logFunction · 0.85

Tested by

no test coverage detected