logging-setup

logging-setup is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 39 tokens per session (953 once invoked), scanned A, original, MIT.

A setup guide for Apple's structured logging system, Logger, which records app events for debugging and monitoring. It replaces basic print statements with logs that can be filtered and marked for privacy.

In plain words
What is it for?
Use it to replace print statements, add debug or production logging, and organize logs by subsystem and category in Swift apps.
Why use it?
It makes app logs easier to inspect in Apple's Console app and safer to use with sensitive values. It also supports different logging behavior in development and released builds.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/logging-setup
Any agent
npx skills add rshankras/claude-code-apple-skills --skill logging-setup
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for logging-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/logging-setup.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/logging-setup)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/logging-setup"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/logging-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 953 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.00953
Opus 5 $0.00019 $0.00477
Sonnet 5 $0.00008 $0.00191
Haiku 4.5 $0.00004 $0.00095

Measured 2d ago against content hash f6e66f669993, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

logging-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/generators/logging-setup/SKILL.md · 142 lines

How it starts

The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 the full file on GitHub · 142 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 142 lines · 39 tokens per session scan A f6e66f669993

Subscribe to this mod's changes

logging-setup is a skill published in the GitHub repository rshankras/claude-code-apple-skills (701 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 953 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

swift-performance-pro

Use when diagnosing or fixing performance — SwiftUI render cost, memory and retain cycles, slow lists, launch time, and using Instruments.

laxrajpurohit/swift-skills-pro · 31 tokens

swiftui-performance

Audit and improve SwiftUI runtime performance. Use when diagnosing slow rendering, janky scrolling, high CPU, memory usage, excessive view updates, layout thrash, body evaluation cost, identity churn, view lifetime issues, lazy loading, Instruments profiling guidance, and performance audit requests.

JordanCoin/ios-skills-collection · 59 tokens

iOS Performance

Memory management, profiling, optimization techniques, and Instruments usage for high-performance iOS apps.

JordanCoin/ios-skills-collection · 21 tokens

swift-concurrency

Resolve Swift concurrency compiler errors, adopt approachable concurrency (SE-0466), and write data-race-safe async code. Use when fixing Sendable conformance errors, actor isolation warnings, or strict concurrency diagnostics; when adopting default MainActor isolation, @concurrent, nonisolated(nonsending), or…

JordanCoin/ios-skills-collection · 103 tokens

motioneyes-animation-debug

Diagnose, fix, or validate SwiftUI animation and scroll behavior by temporarily instrumenting views with MotionEyes, capturing console traces over time, and comparing motion data to user intent or test expectations. Use when users report bugs such as wrong direction, premature fade, timing or easing mismatch…

JordanCoin/ios-skills-collection · 126 tokens

motioneyes-visual-analysis

Pixel-based motion and UI change analysis from frame sequences or screenshots using computer vision and visual comparison. Use when .transition or visual effects are not observable via MotionEyes logs, when you only have screenshots/video, when you need regression diffs across builds, or when you need to summarize…

JordanCoin/ios-skills-collection · 95 tokens