logging-setup_skill

This skill replaces print statements with a structured Swift Logger setup, improving privacy, performance, and debugging across modules.
  • Swift

56

GitHub Stars

3

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill rshankras/claude-code-apple-skills --skill logging-setup

  • logger-patterns.md6.2 KB
  • migration-guide.md4.4 KB
  • SKILL.md3.8 KB

Overview

This skill generates a structured logging infrastructure using Apple's os.log/Logger to replace print() statements. It helps teams add categorized, privacy-aware, and performant logging across Swift apps (iOS, macOS) and provides migration guidance from print().

How this skill works

The skill inspects the codebase for print() calls and any existing os.log/Logger usage, then offers audit results or generates a new AppLogger.swift with subsystem and categories. It can run in audit, generate, or migrate modes to report print locations, create a logging facade, or automatically convert print() calls to Logger invocations with privacy annotations.

When to use it

  • When you want to replace print() statements with structured logging
  • When adding app-wide logging with subsystem/category separation
  • When you need privacy-safe logging (.public/.private/.sensitive)
  • When preparing debug vs Release logging behavior
  • When auditing a codebase for ad-hoc print debugging

Best practices

  • Use categories (Network, Auth, UI, Data, etc.) to filter logs in Console.app
  • Annotate sensitive values with .private or .sensitive to avoid leaking data
  • Prefer deferred Logger interpolation for performance in Release builds
  • Keep a single AppLogger facade to centralize subsystem and category definitions
  • Run an audit pass to classify print() uses before bulk migration

Example use cases

  • Audit: produce a file-by-file report of print() occurrences and suggested severity
  • Generate: create Logging/AppLogger.swift with default categories and usage examples
  • Migrate: replace print("User: (email)") with AppLogger.auth.info("User: (email, privacy: .private)")
  • Setup: add a logging bridge during rollout to avoid breaking runtime behavior
  • Debugging: add temporary debug logs that compile out in Release builds

FAQ

Logger requires iOS 14+/macOS 11+; check your deployment target before generating the logger.

Will migration break existing behavior?

No—Logger preserves runtime logging in Debug and defers costly interpolation; tests and an audit pass are recommended before wide replacement.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational