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

Function cbm_log_mcp_request

src/foundation/log.c:365–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365void cbm_log_mcp_request(const char *method, const char *tool_name, bool is_error,
366 int64_t duration_us) {
367 char duration_ms[CBM_SZ_32];
368 snprintf(duration_ms, sizeof(duration_ms), "%" PRId64, duration_us / 1000);
369 if (tool_name && tool_name[0] != '\0') {
370 cbm_log(is_error ? CBM_LOG_WARN : CBM_LOG_INFO, "mcp.request", "protocol", "jsonrpc",
371 "method", method ? method : "", "tool", tool_name, "status",
372 is_error ? "error" : "ok", "duration_ms", duration_ms, NULL);
373 } else {
374 cbm_log(is_error ? CBM_LOG_WARN : CBM_LOG_INFO, "mcp.request", "protocol", "jsonrpc",
375 "method", method ? method : "", "status", is_error ? "error" : "ok", "duration_ms",
376 duration_ms, NULL);
377 }
378}
379
380void cbm_log_http_request(const char *component, const char *method, const char *path, int status,
381 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