Log.p doesn't work on iOS devices, Log.sendLog doesn't work on anything

98 views
Skip to first unread message

nickk...@gmail.com

unread,
Jul 19, 2017, 6:11:14 PM7/19/17
to CodenameOne Discussions
I have a project that is crashing hard since last Friday's library update but only on iOS.

I have put Log.p thoughout to try and get to the bottom of it, but no Log.p is output on the running console - this used to work for the devices running iOS 9 (it hasn't ever worked on iOS 10 devices as far as I know).

So I put Log.sendLog statements in after my Log.p so I can get them via email for debugging purposes and that doesn't send anything. In fact I haven't had an emailed error report for a new build for a very long time.

I do have a pro account with a different email address to this one and the correct email address is shown in the console when sending a build.

It is very difficult to debug without any logs and when it crashes completely with a crash report and no dSyms. I'll need to work with source to get to the bottom of this in the meantime.

When can logs on iOS 10 (and 9 and 11) be fixed? Why doesn't Log.sendLog work anymore?

Cheers

Shai Almog

unread,
Jul 20, 2017, 12:34:42 AM7/20/17
to CodenameOne Discussions
Send log should work unless you passed 200 emails in the past 48 hours or so in which case we throttle it to prevent inbox flooding.
We recently switched from NSLog to printf due to a user request. It seems Apple made some changes that broke NSLog for most users but printf should work. Steve should know more about this.

nickk...@gmail.com

unread,
Jul 20, 2017, 1:10:03 AM7/20/17
to CodenameOne Discussions
Devices I could get logs from a week or so ago I can no longer see logs on builds sent this week.

I haven't had any where near 200 emails in the past 48 hours.

The only email logs I get are from apps released last year that haven't been updated since - they come in at a rate of a couple per week or less.

Steve Hannah

unread,
Jul 20, 2017, 11:00:22 AM7/20/17
to codenameone...@googlegroups.com
I just built this test and ran it on my iPhone 6S running iOS 10.0.2, and it worked fine.  Both Log.p and System.out.println showed up in the device log, and the log was correctly emailed to my account.

If you can post a test case that I can build and demonstrates the issue (in the issue tracker), I'll take a look.

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/5f5eb7c4-e96b-405e-90a1-acb9ebc8a911%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

nickk...@gmail.com

unread,
Jul 23, 2017, 5:55:34 PM7/23/17
to CodenameOne Discussions
Hi Steve,

Using your code from that gist:
I had to add ios.debug.archs=armv7 to get it running on the old iPad but tried a build without it for the other devices:

Checking iOS logs in XCode and iOS Console on the Mac and idevicesyslog on linux, all of which used to work fine up until a couple of weeks ago.

iPod Touch running iOS 11 beta - no logs and no emails
iPhone running iOS 10.3.1 - no logs and no emails
iPad running iOS 9.3.1 - no logs and no emails.

Simulator - logs but no emails and a stack trace error the second time the button is pushed:

[EDT] 0:0:7,383 - This is from Log.p
This is from System.out.println
[EDT] 0:0:10,39 - This is from Log.p
This is from System.out.println
[Network Thread] 0:0:10,332 - Exception: java.io.IOException - Stream closed
java.io.IOException: Stream closed
at com.codename1.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:140)
at com.codename1.io.BufferedInputStream.read1(BufferedInputStream.java:338)
at com.codename1.io.BufferedInputStream.read(BufferedInputStream.java:445)
at com.codename1.io.BufferedInputStream.read(BufferedInputStream.java:668)
at com.codename1.io.Util.copyNoClose(Util.java:118)
at com.codename1.io.Util.copy(Util.java:135)
at com.codename1.io.Util.copy(Util.java:106)
at com.codename1.io.Util.readInputStream(Util.java:184)
at com.codename1.io.ConnectionRequest.readResponse(ConnectionRequest.java:1258)
at com.codename1.io.ConnectionRequest.performOperation(ConnectionRequest.java:795)
at com.codename1.io.NetworkManager$NetworkThread.run(NetworkManager.java:282)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Android logs but no emails:

07-24 09:49:25.372  5146  5150 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
07-24 09:49:25.615  5146  5150 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
07-24 09:49:25.624  4424  4448 D TestIOSLogging: [EDT] 0:4:35,876 - This is from Log.p
07-24 09:49:25.625  4424  4448 I System.out: This is from System.out.println
07-24 09:49:25.881  5146  5150 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
07-24 09:49:26.009  4424  4448 D TestIOSLogging: [EDT] 0:4:36,260 - This is from Log.p
07-24 09:49:26.009  4424  4448 I System.out: This is from System.out.println
07-24 09:49:26.676   873   873 I MSM-irqbalance: Decided to move IRQ178 from CPU6 to CPU7
07-24 09:49:26.950  5146  5150 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only




Its not sending to this gmail address and it has a very relaxed spam filter on the email address that is being used, and also I DO get emailled logs as long as they are from older builds (such as last year) but anything built more recently does not send email logs.

Hope that helps..
Nick

Shai Almog

unread,
Jul 24, 2017, 12:13:24 AM7/24/17
to CodenameOne Discussions
Hi,
you do use sendLog() right? There is no option there to pick the account to which you send the email. If you try to send to an account that isn't pro or higher this just won't work...

About the console not working, Steve does it make sense to add a build hint that will toggle using printf and NSLog since we now use a macro?

ni...@littlemonkey.co.nz

unread,
Jul 24, 2017, 2:20:39 AM7/24/17
to codenameone...@googlegroups.com
Hi,
Yes I'm using sendLog() both in my own code and in Steve's example.
I have a pro account, the email address I'm expecting logs at is the one I log into the build server with, and it is shown in the NetBeans console when the build is sent, I'm sure that is set up correctly.
My pro subscription is up to date (I have all the monthly receipts) and push notifications, include source etc., all work fine.

--
You received this message because you are subscribed to a topic in the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/codenameone-discussions/9dB5chxQrYU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to codenameone-discu...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/b5c25f8d-7f73-4ea3-b256-a00740db0e66%40googlegroups.com.

Steve Hannah

unread,
Jul 24, 2017, 1:43:12 PM7/24/17
to codenameone...@googlegroups.com

About the console not working, Steve does it make sense to add a build hint that will toggle using printf and NSLog since we now use a macro?

This would be easy to do.  I doubt it would make a difference here but I could be wrong, and there might be other benefits I'm not aware of.

I'm currently working on trying to reproduce this problem by playing with build settings and running on different versions of iOS.  So far I haven't been successful. (Logging working fine for me in all cases).

Steve
 

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.

Steve Hannah

unread,
Jul 24, 2017, 2:08:52 PM7/24/17
to codenameone...@googlegroups.com
I've finally reproduced it.  I had been using Xcode 8 to do the builds.  Changing to Xcode 7 reproduced it.

Fixing this might be tricky (i.e. may require upgrading to Xcode 8 on the build server - and Xcode upgrades almost always come with trade-offs).  Best bet right now is to figure out why the Log.sendLog() isn't reaching you.  (I still can't reproduce this problem).  It should be working.  The most likely scenario is that it is getting blocked by a spam filter.  If you're 100% sure that isn't happening.  Check again so you're 101% sure. There aren't a whole lot of other things that it could be.

Steve

On Mon, Jul 24, 2017 at 10:43 AM, Steve Hannah <steve....@codenameone.com> wrote:

About the console not working, Steve does it make sense to add a build hint that will toggle using printf and NSLog since we now use a macro?

This would be easy to do.  I doubt it would make a difference here but I could be wrong, and there might be other benefits I'm not aware of.

I'm currently working on trying to reproduce this problem by playing with build settings and running on different versions of iOS.  So far I haven't been successful. (Logging working fine for me in all cases).

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

Steve Hannah

unread,
Jul 24, 2017, 2:17:46 PM7/24/17
to codenameone...@googlegroups.com

nickk...@gmail.com

unread,
Jul 24, 2017, 5:05:06 PM7/24/17
to CodenameOne Discussions
I've checked my spam settings, anything marked as spam is delivered to a folder and not deleted, and I've just white listed @codenameone.com (is this the right domain name?)

Note that I still get emails but only from older apps - so if its the spam filter then something would have changed in the email logs to change the spamminess of the emails that are sent which seems unlikely.

The simulator has that stream closed exception on the simulator is that just simulator specific or could that be why the email is not being sent?

Should Message.sendViaCloudSync still work? I could try that in a build and see if that delivers email?

On Tuesday, July 25, 2017 at 6:17:46 AM UTC+12, Steve Hannah wrote:
On Mon, Jul 24, 2017 at 11:08 AM, Steve Hannah <steve....@codenameone.com> wrote:
I've finally reproduced it.  I had been using Xcode 8 to do the builds.  Changing to Xcode 7 reproduced it.

Fixing this might be tricky (i.e. may require upgrading to Xcode 8 on the build server - and Xcode upgrades almost always come with trade-offs).  Best bet right now is to figure out why the Log.sendLog() isn't reaching you.  (I still can't reproduce this problem).  It should be working.  The most likely scenario is that it is getting blocked by a spam filter.  If you're 100% sure that isn't happening.  Check again so you're 101% sure. There aren't a whole lot of other things that it could be.

Steve
On Mon, Jul 24, 2017 at 10:43 AM, Steve Hannah <steve....@codenameone.com> wrote:

About the console not working, Steve does it make sense to add a build hint that will toggle using printf and NSLog since we now use a macro?

This would be easy to do.  I doubt it would make a difference here but I could be wrong, and there might be other benefits I'm not aware of.

I'm currently working on trying to reproduce this problem by playing with build settings and running on different versions of iOS.  So far I haven't been successful. (Logging working fine for me in all cases).

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One



--
Steve Hannah
Software Developer
Codename One

Shai Almog

unread,
Jul 25, 2017, 12:46:21 AM7/25/17
to CodenameOne Discussions
If you are getting crash emails from other apps in the right email address then this means you haven't crossed the 200 email threshold (for 48 hours). That's the main reason for emails not arriving. We limit these to avoid flooding inboxes but also to avoid spam bots.

Send via cloud should work but it won't really tell you much about what's going wrong with the log.

Steve, can't he just change the local macro in xcode 7.x to NSLog or add one of the workarounds?
Message has been deleted

nickk...@gmail.com

unread,
Jul 26, 2017, 11:58:59 PM7/26/17
to CodenameOne Discussions
This works as a Log.sendLog() workaround but I'd still prefer logs off the iOS device to be working again:
            Message m = new Message(Util.readToString(Storage.getInstance().createInputStream("CN1Log__$")));
            
            m.sendMessageViaCloud(.....)

nickk...@gmail.com

unread,
Jul 27, 2017, 12:02:31 AM7/27/17
to CodenameOne Discussions, nickk...@gmail.com
The workaround below sends emails but they are blank on new iOS devices - works fine on the simulator and old iOS devices... I think the log isn't being written at all.

Shai Almog

unread,
Jul 27, 2017, 1:29:02 AM7/27/17
to CodenameOne Discussions, nickk...@gmail.com
That's probably unrelated to that. There is probably something that's broken in the new deployment that is causing issues with the file as the Log.p() and sendLog() are completely separate from native logging.

Dave Dyer

unread,
Jul 27, 2017, 1:41:24 PM7/27/17
to CodenameOne Discussions, nickk...@gmail.com
The whole Log class is something between a mess and a minefield; I've published a
function in another thread that creates a log file and gets it's contents as a string.
You could use this as a guide to get what you need out of the logging system.
For my purposes, I have a very simple perl script on my site which receives
log messages posted by my error catching system, and complely bypasses
codenameone's error logging mechanism.

Shai Almog

unread,
Jul 28, 2017, 12:56:35 AM7/28/17
to CodenameOne Discussions, nickk...@gmail.com
@Dave This is a discussion related to Log.sendLog() and a change Apple made to native logging both of which have no applicability to your point. Log.sendLog() is a pro feature.

nickk...@gmail.com

unread,
Aug 1, 2017, 6:25:38 PM8/1/17
to CodenameOne Discussions, nickk...@gmail.com
No harm in having an alternative that does work if the current system doesn't. However this particular app has no server so I'd really like to keep it that way if at all possible which means the only way I can get logs are through the Codename One systems.

Shai Almog

unread,
Aug 2, 2017, 12:52:54 AM8/2/17
to CodenameOne Discussions, nickk...@gmail.com
Sure but since the Log class hasn't changed in ages and the existing apps work for you I'm not sure how I can help?
See: https://github.com/codenameone/CodenameOne/commits/master/CodenameOne/src/com/codename1/io/Log.java

Log is the same.
The server email process works for your account.
That means something is different with your new vs. old apps and I don't have a guess off the top of my head.
Reply all
Reply to author
Forward
0 new messages