Add unified HomeCommonMenu/HomeAllFunctions diagnostics, rebuild all-functions from top-level menuList permissions, and document Home and AllFunctions module logic. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
1.0 KiB
Swift
30 lines
1.0 KiB
Swift
//
|
||
// HomeAllFunctionsDiagnostics.swift
|
||
// suixinkan
|
||
//
|
||
// Created by Codex on 2026/6/30.
|
||
//
|
||
|
||
import Foundation
|
||
import os
|
||
|
||
/// 「全部功能」页诊断日志,便于与 Android `AllFunctionsViewModel` 输出对比。
|
||
enum HomeAllFunctionsDiagnostics {
|
||
private static let logger = Logger(subsystem: "com.yuanzhixiang.suixinkan", category: "HomeAllFunctions")
|
||
|
||
/// 记录全部功能页的分区菜单 URI 列表。
|
||
static func log(snapshot: HomeAllFunctionsSnapshot) {
|
||
#if DEBUG
|
||
log(step: "allFunctions", uris: snapshot.allFunctions.map(\.uri))
|
||
log(step: "commonFunctions", uris: snapshot.commonFunctions.map(\.uri))
|
||
log(step: "moreFunctions", uris: snapshot.moreFunctions.map(\.uri))
|
||
#endif
|
||
}
|
||
|
||
/// 记录单步 URI 列表。
|
||
private static func log(step: String, uris: [String]) {
|
||
let payload = "count=\(uris.count) uris=\(HomeCommonMenuDiagnostics.formatURIList(uris))"
|
||
logger.debug("step=\(step, privacy: .public) \(payload, privacy: .public)")
|
||
}
|
||
}
|