I'm experimenting with the (relatively) new Logger API after watching WWDC20 session "Explore logging in Swift", and I don't see a default reduction of the values that was discussed in the talk.
When I run this code,
let i = A(a: "aaaa", b: 111)
logger.error("Password: \(i)") // privacy: .auto
logger.error("Password: \(i, privacy: .public)")
logger.error("Password: \(i, privacy: .private)")
logger.error("Password: \(i, privacy: .private(mask: .none))")
logger.error("Password: \(i, privacy: .private(mask: .hash))")
I get this output in both Xcode console and Console.app:
2023-08-20 22:55:57.373918+0300 MyApp[75828:757479] [MyCategory] Password: a: aaaa, b: 111
2023-08-20 22:55:57.373988+0300 MyApp[75828:757479] [MyCategory] Password: a: aaaa, b: 111
2023-08-20 22:55:57.374014+0300 MyApp[75828:757479] [MyCategory] Password: a: aaaa, b: 111
2023-08-20 22:55:57.374032+0300 MyApp[75828:757479] [MyCategory] Password: a: aaaa, b: 111
2023-08-20 22:55:57.374055+0300 MyApp[75828:757479] [MyCategory] Password: a: aaaa, b: 111
My assumption is that when running the code from Xcode with debug build configuration the system generously opens up any private values so I can inspect them conveniently. But when I ran my code with the release config, I got the same output. However, I want to test what data will be stored on my users' devices when I write different privacy options
Any ideas why this happens?