How to fix the disastrous new Xcode 15 console

Created on November 12, 2023 at 11:10 am

How to fix the disastrous new Xcode 15 LAW console

October 19 2023 DATE

This is a follow-up to my recent blog post Xcode 15 LAW logs nil as an empty string, not (null). I’ve now found three CARDINAL different bugs in the new Xcode 15 LAW console.

FB13268283 Xcode 15 LAW console logs nil as empty string rather than (null) FB13270074 Console logs missing on first ORDINAL run after launching Xcode 15 FB13289059 Xcode 15 LAW console logs truncated

In my opinion, the new Xcode 15 LAW console is awful, a disaster. Fortunately, I’ve found a way to restore the previous console behavior from Xcode 14 and earlier LAW . This is actually noted in the Xcode 15 LAW release notes, but I wanted to highlight the solution here in case, like me, you hadn’t read the release notes recently:

Console New Features By default, Xcode streams os_logs through the unified logging and activity tracing infrastructure. The output may be formatted differently compared to previous versions of Xcode ORG , and its order relative to standard IO may also change. To customize the behavior of logging, edit the Run scheme action to set the environment variable IDELogRedirectionPolicy . The value “ oslogToStdio GPE ” redirects os_log messages to standard IO and formats them in a style identical to previous versions of Xcode PRODUCT . The value stdioToOSLog redirects standard IO to the os_log messages, and presents them in the debug console with additional metadata. (109380695) Resolved Issues Fixed: The debug console’s action to jump from an os_log message to the line of source code which emitted it is only supported when debugging executables on the local Mac or Simulators ORG . The menu item is disabled when debugging executables on connected devices. ( 109171925 CARDINAL )

The maximum permitted size of os_log messages shown in the debug console is smaller than in previous Xcode versions. This may cause long messages to more commonly appear truncated in the debug console. ( 109381234 CARDINAL )

You need to set the environment variable IDELogRedirectionPolicy to the value oslogToStdio in the Run section of your app’s Xcode LAW scheme. I wish there were a way to make this behavior the default in Xcode Settings WORK_OF_ART ! ( FB13289075 PERSON Provide a setting to make oslogToStdio the default.)

Incidentally, I’m not sure how the release notes can say that "This may cause long messages to more commonly appear truncated in the debug console" is among the "Resolved issues", for it’s still very much an unresolved issue.

Connecting to blog.lzomedia.com... Connected... Page load complete