Reputation: 187
I'm using Gamemaker Studio 2 and creating an extension to read the errors generated by the interpreter. In Android they are logged to logcat and I am able to parse them out. I'm trying to do the same thing in iOS, but it seems Gamemaker is not writing to the device log as I expected. I can get at the device log by redirecting it to a file using :
freopen([pathForLog cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
Things logged with NSLog are showing up and I can read it. The Gamemaker exceptions however are not showing up even though I can see them in the Xcode console :
2018-07-16 13:57:39.760274-0400 MyGame[34572:12880605] TIC Read Status [6:0x0]: 1:57
2018-07-16 13:57:39.760313-0400 MyGame[34572:12880605] TIC Read Status [6:0x0]: 1:57
2018-07-16 13:57:40.284416-0400 MyGame[34572:12880192] *** objDebugger created!
2018-07-16 13:57:43.301102-0400 MyGame[34572:12880192] GameMaker:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Alarm Event for alarm 0
for object objHowToPlayButton:
There are other things in the console too that are not showing up in the redirected stderr. I'm guessing this is a permission thing and some things the app logs after my redirection is ok to read, but others (perhaps in a different linked library) are not accessible?
Anyone have any direction on what might be going on here? I'm VERY new to Xcode and Objective C... so please be gentle! :-)
Thanks!
Upvotes: 1
Views: 254
Reputation: 187
Sometimes writing it out is all it takes. I realized that it seemed like only the beginning of the console output was appearing in the redirected file. I had to redirect again after the app had started up and then it was accessing the rest of the device log (that was written from my app). Seems some other code cancelled the redirection.
Upvotes: 0