一键导入
logging-guide
OSLog logging conventions — Logger setup, log levels, category naming, and migration from print().
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
OSLog logging conventions — Logger setup, log levels, category naming, and migration from print().
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Implement UI from Figma designs via MCP with a closed-loop pixel-parity check. Extract exact values (never eyeball), translate to SwiftUI, then render→diff→fix against the Figma export until it matches. Use when implementing or auditing UI against Figma.
HTTP networking layer reference — TargetType, HTTPClient, services, error handling.
Fetch CodeRabbit review comments from batch PRs and auto-fix the issues. Pushes fixes and re-requests review.
Run multiple tasks overnight as parallel PRs. Produces a PRD per task, selects skills/rules, spawns isolated agents, and reports PR links.
Run multiple tasks overnight as parallel PRs. Produces a PRD per task, selects skills/rules, spawns isolated agents, and reports PR links.
Run SwiftLint and xcodebuild to verify the project compiles cleanly.
| name | logging-guide |
| description | OSLog logging conventions — Logger setup, log levels, category naming, and migration from print(). |
All logging in the codebase uses Apple's OSLog framework via Logger. Never use print() for logging.
See VultisigApp/VultisigApp/Core/Networking/HTTPClient.swift for the canonical example.
import OSLog
// In a class:
class MyService {
private let logger = Logger(subsystem: "com.vultisig.app", category: "my-service")
}
// In a struct or View (file-level, above the type):
private let logger = Logger(subsystem: "com.vultisig.app", category: "my-view")
struct MyView: View { ... }
| Item | Rule |
|---|---|
| Subsystem | Always "com.vultisig.app" |
| Category | Kebab-case, describes the component (e.g., "http-client", "tx-history-recorder", "home-screen") |
| Access | private let logger — never expose loggers publicly |
| Level | Usage | Example |
|---|---|---|
logger.debug() | Verbose info for development | logger.debug("Headers: \(headers)") |
logger.info() | Normal operational events | logger.info("Cleaned up \(count) old transactions") |
logger.warning() | Recoverable issues | logger.warning("Request cancelled") |
logger.error() | Failures that need attention | logger.error("Failed to load: \(error)") |
import OSLog (alphabetical order with other imports)print("ClassName: message \(value)") with the appropriate log level.error(), info/status → .info(), debug data → .debug()// BAD: print()
print("MyService: Failed to save: \(error)")
// BAD: Redundant class name in message
logger.error("MyService: Failed to save: \(error)")
// GOOD
logger.error("Failed to save: \(error)")