vvkit-swift-swift-logging
Use when adding or reviewing logging in Swift code with os.Logger or an equivalent logging facade.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- vvkit-swift-swift-logging
- description
- Use when adding or reviewing logging in Swift code with os.Logger or an equivalent logging facade.
03 SKILL.md 正文
Swift logging
REQUIRED BACKGROUND: $vvkit-writing-logs — placement, levels and what not to log. This covers
only the Swift specifics.
Codex runtime
Load referenced skills by reading their SKILL.md. Surveyor, reviewer and runner
skills are role instructions, not registered agent types or enforced tool allowlists.
Use a generic subagent only when delegation is available and permitted; otherwise
perform the role inline. Follow the active session's model, context and permission
rules. User authorization takes precedence over imported workflow approval gates.
Claude hooks and plugin commands are not active in this package. Existing
.claude/context/ paths refer to project documents, not Codex configuration.
Declaring a logger
One Logger per type, with subsystem and category:
import OSLog
private let log = Logger(subsystem: "com.example.app", category: "ExampleService")
- Subsystem: the bundle identifier, constant across the module.
- Category: the 3am filter — reuse the one the file already declares.
Privacy annotations
os.Logger redacts dynamic strings by default and shows numerics in the clear. Be explicit:
log.debug("loaded account \(id, privacy: .public)")
log.error("auth failed: \(error.localizedDescription, privacy: .private)")
log.info("user \(email, privacy: .sensitive)")
.public— safe in a sysdiagnose: identifiers, counts, state names..private— redacted in release; the default for interpolated strings..sensitive— credentials and personal data. Prefer not logging it.- A numeric interpolation is public by default — an account id, amount or timestamp is already in the clear.
Levels
Loggerhastrace,debug,info,notice,warning,error,fault.noticeis the persisted default;faultis programmer error, not a failed network call.debugandtraceare not persisted without a live stream. Anything needed in a bug report isinfoor above.
Availability
Logger needs iOS 14 / macOS 11; below that, os_log. Put the #available check in one small
facade, not at every call site.
Checklist
- [ ] Every interpolation has a considered privacy annotation
- [ ] Anything needed in a bug report is
infoor above, notdebug
04 同仓库更多 Skills
no-heading
Use when proving that the validator rejects a body with no H1 and a force-loading @-link.
wrong-name-does-not-match-dir
Dispatches a subagent per task and reviews between each one.
writing-tests
Use when adding or changing behavior, fixing a bug, or judging whether an existing or generated test earns its place.
writing-skills
Use when authoring or editing a skill, agent, command or hook for this kit, or when deciding whether a piece of guidance belongs in a skill at all.
writing-project-instructions
Use when creating or editing a CLAUDE.md or AGENTS.md, when it has grown long, or when a rule in it also exists in an installed skill.
writing-logs
Use when adding or reviewing log statements, or when deciding what level a message belongs at.