/logging-setup
Generates structured logging infrastructure using os.log/Logger to replace print() statements. Use when user wants to add proper logging, replace print statements, or set up app logging.
$ npx -y skills add rshankras/claude-code-apple-skills --skill logging-setup --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/logging-setup
Context preview
The summary Claude sees to decide when to auto-load this skill.
Generates structured logging infrastructure using os.log/Logger to replace print() statements. Use when user wants to add proper logging, replace print statements, or set up app logging.
SKILL.md
logging-setup.SKILL.mdname: logging-setup
description: Generates structured logging infrastructure using os.log/Logger to replace print() statements. Use when user wants to add proper logging, replace print statements, or set up app logging.
allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion]
last_verified: 2026-07-16
review_by: 2027-06-22
os_version: iOS 27 / macOS 27
Logging Setup Generator
Replace print() statements with Apple's structured logging system (os.log/Logger) for better debugging, privacy controls, and Console.app integration.
When This Skill Activates
Use this skill when the user:
- Asks to "add logging" or "set up logging"
- Wants to "replace print statements"
- Mentions "os.log", "Logger", or "structured logging"
- Asks about "debug logging" or "production logging"
- Wants to audit print() usage in their codebase
Why Logger Over print()
| print() | Logger | |---------|--------| | Always executes | Debug logs compiled out in Release | | No filtering | Filter by subsystem/category in Console.app | | No privacy | .private, .public, .sensitive annotations | | String interpolation always runs | Deferred evaluation (performance) | | Not in Console.app | Full system integration |
Pre-Generation Checks
1. Project Context Detection
- [ ] Check deployment target (Logger requires iOS 14+ / macOS 11+)
- [ ] Search for existing Logger/os.log usage
- [ ] Identify source file locations (Sources/, App/, etc.)
2. Conflict Detection
Search for existing logging:
Glob: **/*Logger*.swift
Grep: "import OSLog" or "os_log"
If found, ask user:
- Extend existing logging?
- Replace with new implementation?
- Create separate logger?
Modes of Operation
Mode 1: Audit
Find all print() statements and report:
Grep: print\s*\(
Report format:
- File:line - print statement
- Severity: Info/Warning/Error (based on context)
- Suggested Logger level
Mode 2: Generate
Create logging infrastructure from scratch.
Mode 3: Migrate
Convert existing print() to Logger with suggestions.
Configuration Questions
Ask user via AskUserQuestion:
1. **Categories needed?**
- Network, Auth, UI, Data (defaults)
- Custom categories?
2. **Include migration helpers?**
- Extension on String for quick migration
- Temporary print-to-log bridge
Generation Process
Step 1: Create AppLogger.swift
Read template from `templates/AppLogger.swift` and customize:
- Set subsystem from Bundle.main.bundleIdentifier
- Add user-specified categories
- Include usage examples in comments
Step 2: Determine File Location
Check project structure:
- If `Sources/` exists → `Sources/Logging/AppLogger.swift`
- If `App/` exists → `App/Logging/AppLogger.swift`
- Otherwise → `Logging/AppLogger.swift`
Step 3: Provide Migration Guidance
Show examples of converting common print patterns:
// Before
print("User logged in: \(email)")
// After
AppLogger.auth.info("User logged in: \(email, privacy: .private)")Output Format
After generation, provide:
Files Created
- `[Path]/Logging/AppLogger.swift`
Integration Steps
1. Import in files: `import OSLog` (not needed if using AppLogger) 2. Replace print() calls with AppLogger.[category].[level]() 3. Add privacy annotations for sensitive data
Privacy Annotations Guide
- `.public` - Safe to log (IDs, counts, non-sensitive)
- `.private` - Redacted in release (emails, names)
- `.sensitive` - Always redacted (passwords, tokens)
Console.app Usage
1. Open Console.app 2. Filter by subsystem: `com.yourapp` 3. Filter by category: `Network`, `Auth`, etc.
Testing Instructions
1. Add a test log: `AppLogger.general.debug("Test log")` 2. Run app, check Xcode console 3. Open Console.app, filter by your app's subsystem
References
- **logger-patterns.md** - Best practices and privacy levels
- **migration-guide.md** - Converting print() to Logger
- **templates/AppLogger.swift** - Template file
Read more
name: logging-setup description: Generates structured logging infrastructure using os.log/Logger to replace print() statements. Use when user wants to add proper logging, replace print statements, or set up app logging. allowed-tools: [Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion] last_verified: 2026-07-16 review_by: 2027-06-22 os_version: iOS 27 / macOS 27
Logging Setup Generator
Replace print() statements with Apple's structured logging system (os.log/Logger) for better debugging, privacy controls, and Console.app integration.
When This Skill Activates
Use this skill when the user:
- Asks to "add logging" or "set up logging"
- Wants to "replace print statements"
- Mentions "os.log", "Logger", or "structured logging"
- Asks about "debug logging" or "production logging"
- Wants to audit print() usage in their codebase
Why Logger Over print()
| print() | Logger | |---------|--------| | Always executes | Debug logs compiled out in Release | | No filtering | Filter by subsystem/category in Console.app | | No privacy | .private, .public, .sensitive annotations | | String interpolation always runs | Deferred evaluation (performance) | | Not in Console.app | Full system integration |
Pre-Generation Checks
1. Project Context Detection
- [ ] Check deployment target (Logger requires iOS 14+ / macOS 11+)
- [ ] Search for existing Logger/os.log usage
- [ ] Identify source file locations (Sources/, App/, etc.)
2. Conflict Detection
Search for existing logging:
Glob: **/*Logger*.swift Grep: "import OSLog" or "os_log"
If found, ask user:
- Extend existing logging?
- Replace with new implementation?
- Create separate logger?
Modes of Operation
Mode 1: Audit
Find all print() statements and report:
Grep: print\s*\(
Report format:
- File:line - print statement
- Severity: Info/Warning/Error (based on context)
- Suggested Logger level
Mode 2: Generate
Create logging infrastructure from scratch.
Mode 3: Migrate
Convert existing print() to Logger with suggestions.
Configuration Questions
Ask user via AskUserQuestion:
1. **Categories needed?**
- Network, Auth, UI, Data (defaults)
- Custom categories?
2. **Include migration helpers?**
- Extension on String for quick migration
- Temporary print-to-log bridge
Generation Process
Step 1: Create AppLogger.swift
Read template from `templates/AppLogger.swift` and customize:
- Set subsystem from Bundle.main.bundleIdentifier
- Add user-specified categories
- Include usage examples in comments
Step 2: Determine File Location
Check project structure:
- If `Sources/` exists → `Sources/Logging/AppLogger.swift`
- If `App/` exists → `App/Logging/AppLogger.swift`
- Otherwise → `Logging/AppLogger.swift`
Step 3: Provide Migration Guidance
Show examples of converting common print patterns:
// Before
print("User logged in: \(email)")
// After
AppLogger.auth.info("User logged in: \(email, privacy: .private)")Output Format
After generation, provide:
Files Created
- `[Path]/Logging/AppLogger.swift`
Integration Steps
1. Import in files: `import OSLog` (not needed if using AppLogger) 2. Replace print() calls with AppLogger.[category].[level]() 3. Add privacy annotations for sensitive data
Privacy Annotations Guide
- `.public` - Safe to log (IDs, counts, non-sensitive)
- `.private` - Redacted in release (emails, names)
- `.sensitive` - Always redacted (passwords, tokens)
Console.app Usage
1. Open Console.app 2. Filter by subsystem: `com.yourapp` 3. Filter by category: `Network`, `Auth`, etc.
Testing Instructions
1. Add a test log: `AppLogger.general.debug("Test log")` 2. Run app, check Xcode console 3. Open Console.app, filter by your app's subsystem
References
- **logger-patterns.md** - Best practices and privacy levels
- **migration-guide.md** - Converting print() to Logger
- **templates/AppLogger.swift** - Template file
A collection of Claude Code skills for iOS, macOS, watchOS, visionOS, and Apple platform development. These skills help you plan and build apps, maintain code quality, ensure HIG compliance, and guide you from idea to App Store.
Repo: rshankras/claude-code-apple-skills
Other skills on rshankras-apple-skills.
- /app-store
App Store optimization and marketing skills for descriptions, screenshots, keywords, review responses, and comprehensive promotional strategy. Use when user needs help with App Store presence, ASO, marketing, or customer communication.
Open skill - /ad-attribution
Privacy-preserving ad measurement with AdAttributionKit (SKAdNetwork's successor) — install and re-engagement attribution, conversion-value strategy under crowd anonymity, and end-to-end postback testing. Use when running paid acquisition beyond Apple Ads, measuring
Open skill - /app-description-writer
Generate compelling App Store descriptions that convert browsers into users. Use when writing initial descriptions, improving existing copy, or drafting promotional text and What's New for a major update.
Open skill - /apple-search-ads
Apple Search Ads campaign strategy for indie developers — paid acquisition, keyword bidding, budget planning, and ROAS optimization. Use when user asks about running ads, paid user acquisition, or Apple Search Ads campaigns.
Open skill - /iap-finalizer
Take a one-time in-app purchase from MISSING_METADATA to READY_TO_SUBMIT in App Store Connect — set its price schedule and localized display name/description (and optional review screenshot) via the ASC REST API. Use at Phase 6 (Pre-Release), after the IAP is built in-app (Phase
Open skill - /keyword-optimizer
Optimize app title, subtitle, and keywords for maximum App Store discoverability. Use when launching a new app, improving search rankings, entering new markets/languages, or safely optimizing ASO for an app with existing traffic.
Open skill

