OSLog output in Xcode console ignoring OSLogIntegerFormatting?!

In my Swift macOS app, I use OSLog logging via the line:

logger.log("••• channel \(channel, format: .octal(minDigits: 3))")

.. and the Xcode console shows:

••• channel 29

.. the formatting to octal and minDigits are ignored. I've searched high and low for why this is happening (another app with the same line results in correct Xcode console output).

The Console.app does show the correct output:

••• channel 035

Any suggestions regarding what I'm not understanding? Thanks.

Hi, Thanks for submitting this issue. Please file a feedback on Xcode, here. Also please include the FB number in this thread so it can be tracked more easily. In your report please include an xcresult bundle for a run that is effected by this. (Report Navigator > Select Run > Right Click Run > Show In Finder) Additionally please include Xcode version, macOS version, and optionally external device OS version if ran on a device.

FB: FB14340500

(While composing the report, the zip'd xcresult bundles from last night were deleted, by Xcode?, so I built/run the app again and enclosed the new one)

I was logging a lot of data very fast and found a suggestion, buried in the log, to use “IDELogRedirectionPolicy=oslogToStdio” to avoid potential loss. Using that environment setting restored the desired formatting!

"[guessing] .. I understand the “IDELogRedirectionPolicy” can influence how logging behaves (the 'privacy' for example) but could it be that very high rates of logging cause the logging system to save time by not doing formatting .. that kind of makes sense; the logged data is still correct, just not formatted?

I see "IDELogRedirectionPolicy" is mentioned in the Xcode 15 release notes.

OSLog output in Xcode console ignoring OSLogIntegerFormatting?!
 
 
Q