Timestamped Xcode Log Message How do I parse this to find source of error?

with the latest Xcode that runs with Mac OS 14.5 Developer Beta has messages with a time and date in them There are also some other fields of an indeterminate origin/type.

"2024-05-06 15:37:32.383996-0500 RoomPlanExampleApp[24190:1708576] [CAMetalLayerDrawable texture] should not be called after already presenting this drawable. Get a nextDrawable instead."

specifically I need to know how the string [24190:1708576] relates to a location in my application so I can act on the message. I certainly can't find the text in the "[CAMetalLayerDrawable texture]". field anywhere in the user documentation OR the Development documentation. In order for a diagnostic message to be Actionable and remedied by a user it must identify the module and source line of the initiating code and there must be accessible documentation for users to access to get an explanation of potential remedies.. This interface fails to supply enough information to diagnose the problem. The label in [CAMetalLayerDrawable texture] cannot even be found in a search of the package information attached to the Xcode Release paired with the IOS and Mac OS system releases.

Replies

specifically I need to know how the string [24190:1708576] relates to a location in my application

It does not. Consider this tiny program:

import Foundation

func main() {
    NSLog("Hello Cruel World!")
}

main()

If you run it from Terminal you see this:

% ./Test751247
2024-05-07 08:31:33.065 Test751247[46302:8945816] Hello Cruel World!

Note the Test751247[46302:8945816], which looks similar to what you’re seeing. In that string:

  • Test751247 is the name of the program.

  • 46302 is the process ID.

  • 8945816 is the thread ID.

It tells you nothing about your source code.

Note This name[pid:tid] convention is pretty common on Apple platforms. It’s an extension of a common Unix-y convention of name[pid].


In order for a diagnostic message to be Actionable and remedied by a user

The system log has multiple users, including the owner of the device, third-party developers writing apps for the device, and the folks at Apple writing the system software. The vast majority of system log entries are for the benefit of the latter. As a third-party developer, you can’t assume that every log entry you see is relevant to you. I talk more about this idea in On Log Noise.

If you want to learn more about the system log, I have a bunch of links to docs and so on in Your Friend the System Log.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

In Xcode you can define a symbolic breakpoint on -[CAMetalLayerDrawable texture] to break each time this method is called (including the valid calls). This can help you find where this is used in your app.