Skip to content

Instantly share code, notes, and snippets.

@otto-schnurr
Last active March 27, 2021 07:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otto-schnurr/696483097c2d84e8518886203bdad154 to your computer and use it in GitHub Desktop.
Save otto-schnurr/696483097c2d84e8518886203bdad154 to your computer and use it in GitHub Desktop.
Notes: iOS Unified Logging

From WWDC 2016: Unified Logging and Activity Tracing.

Apple Recommendations

  • os_log: Critical details for debugging issues.
  • os_log_info: Additional information to embed in error or fault reports.
  • os_log_debug: Optional, high-volume information that can be explicitly turned on during development.
  • os_log_error: Additional app information is bundled into the log message.
  • os_log_fault: Additional system information is bundled into the log message.

Heuristics

  • Did something go wrong that was beyond our control?
    • Yes: Was the issue generated by the system outside the app?
      • Yes: os_log_fault
      • No: os_log_error
    • No: Is this information only useful in crash reports?
      • Yes: os_log_info
      • No: Is this noisy information that we only occassionally want to turn on during development?
        • Yes: os_log_debug
        • No: os_log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment