Add debugFetch wrapper in log.js that logs method, URL, and body on request, and status code on response. Replace all fetch() calls across balances, transactions, tokens, background RPC proxy, and settings validation with debugFetch.
이 커밋은 다음에 포함됨:
+11
-1
@@ -27,4 +27,14 @@ const log = {
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = { log };
|
||||
// Fetch wrapper that debug-logs every request and response.
|
||||
async function debugFetch(url, opts) {
|
||||
const method = (opts && opts.method) || "GET";
|
||||
const body = opts && opts.body;
|
||||
log.debugf("fetch →", method, url, body || "");
|
||||
const resp = await fetch(url, opts);
|
||||
log.debugf("fetch ←", resp.status, url);
|
||||
return resp;
|
||||
}
|
||||
|
||||
module.exports = { log, debugFetch };
|
||||
|
||||
새 이슈에서 참조
사용자 차단