MCPcopy Create free account
hub / github.com/MigoXLab/coderio / saveDebugLog

Function saveDebugLog

src/utils/axios.ts:9–24  ·  view source on GitHub ↗

* Save debug log

(
    requestInfo: { url: string; config: AxiosRequestConfig },
    responseInfo: { status: number; statusText: string; data: unknown }
)

Source from the content-addressed store, hash-verified

7 * Save debug log
8 */
9function saveDebugLog(
10 requestInfo: { url: string; config: AxiosRequestConfig },
11 responseInfo: { status: number; statusText: string; data: unknown }
12): void {
13 const debugConfig = getDebugConfig();
14 if (!debugConfig.enabled) {
15 return;
16 }
17 const debugContent = [
18 '------------request------------',
19 JSON.stringify(requestInfo, null, 2),
20 '------------response------------',
21 JSON.stringify(responseInfo, null, 2),
22 ].join('\n');
23 writeFile(workspaceManager.path?.debug ?? '', `fetch_${new Date().toISOString().replace(/:/g, '-')}.md`, debugContent);
24}
25
26/**
27 * Axios get request with debug logging

Callers 1

getFunction · 0.85

Calls 2

getDebugConfigFunction · 0.90
writeFileFunction · 0.90

Tested by

no test coverage detected