mirror of
https://github.com/Moe-Sakura/Wrangler-API.git
synced 2026-03-27 06:19:45 +08:00
refactor: 统一日志输出方式并移除冗余检查
* 移除 `src/utils/httpClient.ts` 中自定义的 `logToCF` 日志函数。 * 将 `src/core.ts` 中所有 `logToCF` 调用替换为 `console.log` 进行结构化日志输出。 * 删除 `src/platforms/gal/xxacg.ts` 中无匹配项但存在 HTML 的特定错误检查。
This commit is contained in:
@@ -38,23 +38,4 @@ export async function fetchClient(
|
||||
} finally {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 向 Cloudflare 发送日志。
|
||||
* @param data 要记录的数据对象。
|
||||
*/
|
||||
export async function logToCF(data: object) {
|
||||
// 在此处添加 console.log,以便在 Cloudflare 控制台也能看到日志
|
||||
console.log(JSON.stringify(data));
|
||||
try {
|
||||
await fetch("https://log.gal.homes", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Failed to log to Cloudflare:", error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user