ios logging

Is this a recent build thing?

No, that has been around for a very long time. 

Rob

Rich,

We’re you able to resolve this? I am seeing the same issue on an iPad 4 that I upgraded to iOS 10.0.1. None of my print statements show up in the Xcode console log. As a matter if fact, the word “Corona” is nowhere to be found in the logs. I upgraded Xcode from 7 to 8 but that did not resolve the issue. I do not think it is a global override of the “print” or “debug” commands as my devices with older versions of iOS (pre 10) with the same app installed show the print statements correctly. I am running Corona SDK 2019.2951.

Thanks,

Scott

UPDATE: I upgraded to Corona SDK 2016.2952 (has iOS 10 support) and the print statements now appear in the Xcode console for me.

Thanks for the update @gsglawson.

Yes looks like a newer build resolved the issue which had me pulling my hair out for a day

I’m running 2955 and I’m seeing this issue on iOS 10 devices.  

On iOS 9 everything prints fine, but on iOS 10 there is a ton of useless junk being logged, but not a single print from Corona.

What happens if you run the latest daily build?

Rob

Just updated Enterprise and SDK to the latest daily build (2991), and I still don’t see a single Corona print statement in the Xcode device log (I should have hundreds showing).

I’m not overwriting the print function (I do that in release builds, but this is a debug build).

I do not have any variables called “debug”. The closest I have is a variable in a table, called globals.isDebug.

Alan,

I too had tons of trouble wading through the massive amounts of data in the xcode logfiles when connected to IOS 10 devices. I “solved” my issue by using the Advanced Logging code by Daniel Strmecki. I made a slight modification to his code to stamp every line with special characters (CJBB* in my case). I then use theIOS Consoleapp from LemonJar to filter on those special characters.

A thread with more info is here.

Hope this helps!

Scott

I wouldn’t mind wading through all the data, if there was a single print statement to be found in it.  

Looking at the link you’ve sent, I’d also have to change all of my print call to log:log() calls. I guess I could do that with find and replace, but I’m concerned that I’m not seeing any prints in the first place. As I say I should be seeing hundreds of them, even with the excessive logging I’d expect to be able to see some of them.

Yes, you would have to change the print statements to log:log. I found Daniel’s code to be very beneficial because not only does it “print” to the console, it also writes your print messages to log files on the device. So when a user has an issue or an error, the log files from the device can be emailed to you. Well worth it on a new app…

I’ve just quickly looked, and while getting the log files from a device would be useful, during development I need to be able to see the console output as quickly as possible. Unfortunately, it looks like this logging module simply uses Corona’s own print function to do that:

-- Log in console if (log.logInfoInConsole == true) then print(message) end

and so I’d be in exactly the same position I am now, where nothing appears.

I took a look and the word “Corona” is not stamped on my print messages in the console log for my IOS 10 iPad so if you are using “adb logcat Corona:v *:s” then it may not find your statements. Try using the IOS Console app I mentioned above and filter on some other part of your print statements to see if they are actually there.

What OS platform are you on? 10.11, 10.12?

What version of Xcode are you using?

Are you attempting to use the Corona console log or Xcode’s Devices to view the log?

FWIW, we don’t prefix “Corona” to the beginning of log messages. On Android, the activity gets prepended to output messages, but on iOS it’s just a time stamp that get’s prepended.

I just checked with the simulator and I’m getting prints in the Corona console.log. Of course this may not be of much help for Enterprise builds.

I’m using Enterprise only for these builds. In the simulator I get logs as expected, I don’t have any issue there. On Android everything prints fine, and on iOS 9 devices everything prints fine. The only environment where I see zero prints is iOS 10 devices.

I’m using Xcode’s Devices to read the logs from my iPad Air 2 running iOS 10.0.2, the simulator isn’t enough because I need to test Facebook login, ad networks etc.

I’m using OSX 10.10 and Xcode 7.2, however a colleague is running OSX 10.12.1, Xcode 8.1 and testing on an iPad Air running iOS 10.1.1 and is experiencing the same issue if he installs my builds and looks at the logs.  

Just to be clear, my issue is not that my print calls are difficult to find or hidden in amongst the other logging data, they are simply not there at all. I didn’t filter for “Corona” or anything else, I copied approx 30000 lines of log output from Xcode Devices to Sublime Text and looked through it in detail. I searched for strings that I know for sure appear every time the app runs, and they were nowhere to be found. I looked through the log manually for any signs of anything that I’ve printed. In the simulator I have about 10000 lines printed, so it should be very easy to see.

I tried using the iOS Console App that gsglawson recommended, but the same problem is happening. It’s as if the print statement are totally blocked, I also don’t see any NSLog calls that are in my native code. Does the print function get mapped to NSLog behind the scenes? 

I’ve found a stack overflow post showing that other people have had issues with NSLog calls not working on iOS 10:

http://stackoverflow.com/questions/37886600/ios-10-doesnt-print-nslogs

I’ve tried the suggest fix of adding the “os_activity_mode” environment variable, but that hasn’t worked. I’ll try updating OSX and Xcode tonight and see if that works, after that I’m out of ideas.

If anyone else runs into this problem, it turned out that updating OSX, Xcode and Corona to the most recent verions and then rebuilding the ipa file seems to have done the trick.  

At least it has on one of the devices, the other one is halfway around the world so will have to check that later but hopefully they are both able to print out now.

@gsglawson - that iOS Console is actually very helpful for filtering out all of iOS’s spam.

I tend to create my own “debug print” function so that I can easily block lots of print statements when I release an app (sometimes I want to still have some prints in the release version so I still use the built in print function for those).

I’ve added a prefix that can be easily filtered so that you can get just your own print statements, and not other logs which may contain the word “corona” such as:

Nov 16 17:17:07 my-iPad mDNSResponder[94] \<Info\>: &nbsp;17: DNSServiceGetAddrInfo(stats.coronalabs.com., AAAA) ADD &nbsp; &nbsp;0 stats.coronalabs.com. AAAA&nbsp;

Here’s the function in case it’s of any use to you or anyone else:

local printPrefix = system.getInfo("environment") == "simulator" and "" or "CoronaMyApp: " function dprint(...) if isDebug then if arg and #arg \> 0 then local str = "" for i = 1, #arg do str = str..", "..tostring(arg[i]) end print(printPrefix..str) end end end

Just change “CoronaMyApp” to whatever is useful for you as a filter, and then call dprint() instead of print.  It will only print the prefix on a device, in the sim it will not. If you want it to add a prefix in the sim, then change the empty “” at the top to contain whatever string you want to use as the prefix.

There is also an “isDebug” bool in there, you will need isDebug = true somewhere above this function in order for it to print, otherwise dprint() will just do nothing. Alternatively you could just comment out the “if isDebug then” and the “end” that goes with it.