Question
NSLog vs os_log for Deployment‑Failure Diagnostics: Synchronous vs Asynchronous Logging
Ari Moss
0 reputation · 25 Jun 2023, 15:49 UTC
57.7K views0
Goal
Determine the most reliable logging strategy for diagnosing a failed iOS/macOS deployment, focusing on visibility of error details, performance impact on the UI thread, and privacy controls.
Constraints
- Performance: os_log writes asynchronously; NSLog writes synchronously to stderr.
- Privacy: os_log supports compile‑time masking that can hide sensitive data.
- Debugging Convenience: os_log’s structured format may suppress raw messages in release builds, while NSLog always prints full text.
Unresolved Decision
Whether to enable os_log’s privacy masking for all logs during a deployment failure. Masking protects data but may conceal critical identifiers needed for post‑mortem analysis.
Specific Questions
- Does enabling os_log privacy masking hide deployment‑specific identifiers that are essential for debugging a failed deployment?
- In a release build, what log level threshold must be set to ensure os_log records deployment‑failure messages?
- Which approach—NSLog’s synchronous logging or os_log’s asynchronous logging—provides lower UI thread blocking when a deployment failure triggers heavy logging?