mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-05-30 01:31:06 +08:00
feat(update-center): 添加详细日志记录以帮助调试更新中心服务
在更新中心服务的关键路径添加console.log和console.error输出 包括服务刷新、包解析、命令执行等环节的输入输出和中间状态 便于排查更新中心相关的问题
This commit is contained in:
@@ -262,10 +262,19 @@ const compareVersions = (left: string, right: string): number => {
|
||||
|
||||
export const parseAptssUpgradableOutput = (
|
||||
output: string,
|
||||
): UpdateCenterItem[] => parseUpgradableOutput(output, "aptss");
|
||||
): UpdateCenterItem[] => {
|
||||
console.log(`[UpdateCenter] parseAptssUpgradableOutput input (first 1000 chars): ${output.substring(0, 1000)}`);
|
||||
const result = parseUpgradableOutput(output, "aptss");
|
||||
console.log(`[UpdateCenter] parseAptssUpgradableOutput result count=${result.length}`);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const parseApmUpgradableOutput = (output: string): UpdateCenterItem[] =>
|
||||
parseUpgradableOutput(output, "apm");
|
||||
export const parseApmUpgradableOutput = (output: string): UpdateCenterItem[] => {
|
||||
console.log(`[UpdateCenter] parseApmUpgradableOutput input (first 1000 chars): ${output.substring(0, 1000)}`);
|
||||
const result = parseUpgradableOutput(output, "apm");
|
||||
console.log(`[UpdateCenter] parseApmUpgradableOutput result count=${result.length}`);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const parsePrintUrisOutput = (
|
||||
output: string,
|
||||
@@ -273,8 +282,11 @@ export const parsePrintUrisOutput = (
|
||||
UpdateCenterItem,
|
||||
"downloadUrl" | "fileName" | "size" | "sha512"
|
||||
> | null => {
|
||||
const match = output.trim().match(PRINT_URIS_PATTERN);
|
||||
const trimmed = output.trim();
|
||||
console.log(`[UpdateCenter] parsePrintUrisOutput input (first 500 chars): ${trimmed.substring(0, 500)}`);
|
||||
const match = trimmed.match(PRINT_URIS_PATTERN);
|
||||
if (!match) {
|
||||
console.log(`[UpdateCenter] parsePrintUrisOutput: no match found for pattern ${PRINT_URIS_PATTERN}`);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user