This is a follow-up to my recent blog post Xcode 15 logs nil as an empty string, not (null). I've now found three different bugs in the new Xcode 15 console.
In my opinion, the new Xcode 15 console is awful, a disaster. Fortunately, I've found a way to restore the previous console behavior from Xcode 14 and earlier. This is actually noted in the Xcode 15 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_logsthrough the unified logging and activity tracing infrastructure. The output may be formatted differently compared to previous versions of Xcode, 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 variableIDELogRedirectionPolicy. The value “oslogToStdio” redirectsos_logmessages to standard IO and formats them in a style identical to previous versions of Xcode. The value stdioToOSLog redirects standard IO to theos_logmessages, and presents them in the debug console with additional metadata. (109380695)Resolved Issues
Fixed: The debug console’s action to jump from an
os_logmessage to the line of source code which emitted it is only supported when debugging executables on the local Mac or Simulators. The menu item is disabled when debugging executables on connected devices. (109171925)The maximum permitted size of
os_logmessages 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)
You need to set the environment variable IDELogRedirectionPolicy to the value oslogToStdio in the Run section of your app's Xcode scheme. I wish there were a way to make this behavior the default in Xcode Settings! (FB13289075 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.