Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/rshankras-logging-setup/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 0% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -35% | 0% |
| case-16 | ✗→✓ | ▲ Improved | -17% | 0% |
Replace print() statements with Apple's structured logging system (os.log/Logger) for better debugging, privacy controls, and Console.app integration.
Use this skill when the user:
| 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 |
Search for existing logging:
Glob: **/*Logger*.swift
Grep: "import OSLog" or "os_log"If found, ask user:
Find all print() statements and report:
Grep: print\s*\(Report format:
Create logging infrastructure from scratch.
Convert existing print() to Logger with suggestions.
Ask user via AskUserQuestion:
Read template from templates/AppLogger.swift and customize:
Check project structure:
Sources/ exists → Sources/Logging/AppLogger.swiftApp/ exists → App/Logging/AppLogger.swiftLogging/AppLogger.swiftShow examples of converting common print patterns:
swift// Before print("User logged in: \(email)") // After AppLogger.auth.info("User logged in: \(email, privacy: .private)")
After generation, provide:
[Path]/Logging/AppLogger.swiftimport OSLog (not needed if using AppLogger).public - Safe to log (IDs, counts, non-sensitive).private - Redacted in release (emails, names).sensitive - Always redacted (passwords, tokens)com.yourappNetwork, Auth, etc.AppLogger.general.debug("Test log")Other measured skills in the registry, with their headline benchmark lift.