Skip to content

Replace #if DEBUG print() with os.Logger for structured logging#22

Merged
dadachi merged 1 commit intomainfrom
replace-debug-print-with-os-logger
Mar 25, 2026
Merged

Replace #if DEBUG print() with os.Logger for structured logging#22
dadachi merged 1 commit intomainfrom
replace-debug-print-with-os-logger

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented Mar 25, 2026

Summary

  • Make appLogger internal (was private) so it can be used across the codebase
  • Replace all 6 #if DEBUG print() #endif blocks with appLogger.debug(..., privacy: .private) calls
  • Add import os to files that now use appLogger directly

Files changed: Logger.swift, LoginRepository.swift, SignUpRepository.swift, NFCManager.swift, KeychainStore.swift, Utility.swift

os.Logger.debug() messages are not persisted to disk and values marked privacy: .private are redacted unless a debugger is attached, making #if DEBUG guards unnecessary.

Test plan

  • Verify Release builds do not expose sensitive data in console logs
  • Verify Debug builds show expected log output in Xcode Console
  • Run full test suite

🤖 Generated with Claude Code

Make appLogger internal and replace all 6 #if DEBUG print() blocks with
appLogger.debug(..., privacy: .private) calls. os.Logger.debug() messages
are not persisted to disk and privacy: .private values are redacted unless
a debugger is attached, making #if DEBUG guards unnecessary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit ebe4b5d into main Mar 25, 2026
2 checks passed
@dadachi dadachi deleted the replace-debug-print-with-os-logger branch March 25, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant