oslog-logger-defaultslisted
Install: claude install-skill wei18/apple-dev-skills
# OSLog / `os.Logger` Defaults
## When to invoke
- Starting a new Apple-platform project and picking a logging library.
- Writing the first `Logger` declaration.
- Deciding the default for privacy interpolation.
- User asks "OSLog vs SwiftLog vs Sentry / CocoaLumberjack", "`.private` vs `.public` how to pick".
## Default decisions
- **Use Apple's built-in `os.Logger`** (`import os`); **do not pull in any third-party logging library**.
- Naming conventions:
- `subsystem` = bundle ID (e.g. `com.example.myapp`)
- `category` = module name (aligned with the SwiftPM target name)
- **Privacy interpolation is type-dependent, not "all private"**: dynamic strings and complex objects default to `.private`; integer, floating-point, and Boolean values default to `.public`. Any identifying numeric value (player ID, user ID, serial number) must be marked `.private` explicitly.
```swift
import os
extension Logger {
static let engine = Logger(subsystem: "com.example.myapp", category: "Engine")
}
Logger.engine.info("user \(userId, privacy: .public) loaded puzzle \(puzzleId, privacy: .private)")
// ^^^^^^^ explicit public ^^^^^^^ explicit private —
// identifying values need this
// even when the type (Int, Bool)
// would otherwise default pu