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

Function cbm_log_mcp_request

src/foundation/log.c:280–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280void cbm_log_mcp_request(const char *method, const char *tool_name, bool is_error,
281 int64_t duration_us) {
282 char duration_ms[CBM_SZ_32];
283 snprintf(duration_ms, sizeof(duration_ms), "%" PRId64, duration_us / 1000);
284 if (tool_name && tool_name[0] != '\0') {
285 cbm_log(is_error ? CBM_LOG_WARN : CBM_LOG_INFO, "mcp.request", "protocol", "jsonrpc",
286 "method", method ? method : "", "tool", tool_name, "status",
287 is_error ? "error" : "ok", "duration_ms", duration_ms, NULL);
288 } else {
289 cbm_log(is_error ? CBM_LOG_WARN : CBM_LOG_INFO, "mcp.request", "protocol", "jsonrpc",
290 "method", method ? method : "", "status", is_error ? "error" : "ok", "duration_ms",
291 duration_ms, NULL);
292 }
293}
294
295void cbm_log_http_request(const char *component, const char *method, const char *path, int status,
296 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