Log messages not appearing on the iOS simulator console

491 views
Skip to first unread message

P5music

unread,
Jul 3, 2021, 4:46:20 AM7/3/21
to CodenameOne Discussions
I am testing my CN1 app on the iOS simulator.
I had many lines like
System.out.println("something to be logged");
throughout the app.

I replaced all those lines with static calls to
MyUtils.MyLog(string);

that just wraps the println instruction with an if condition like
if (logAllowed) System.out.println(param);

I put logAllowed=true just inside the MyLog method.
The log messages are printed in the CN1 simulator console

but I cannot see such console messages on the iOS simulator.

It is likely it does not depend on the Utils.MyLog call (or it is because it is static?).

So is there something that can prevent the logging from appearing in the iOS simulator console? I do not see any message, not even the usual messages from CN1 or the system.
But the Swift version of my app correctly logs as usual on the same iOS simulator instance.

Thanks in advance

Shai Almog

unread,
Jul 3, 2021, 9:57:31 PM7/3/21
to CodenameOne Discussions
Try using Log.p(String).

P5music

unread,
Jul 4, 2021, 3:43:51 AM7/4/21
to CodenameOne Discussions
It does not work. Nothing changes.
Nothing is displayed in the console, not even the other stuff from the system or CN1.
The process is attached. I also detached and attached again.
Regards

Shai Almog

unread,
Jul 4, 2021, 10:05:44 PM7/4/21
to CodenameOne Discussions
If nothing appears then this isn't us. It's an environment problem, not sure how to debug that.

Hannah R

unread,
Jul 5, 2021, 9:21:03 AM7/5/21
to CodenameOne Discussions
Just in case, maybe try Log.p("Message ", Log.DEBUG); too. 
It should be the same as suggested by Shai, but it never hurts to try. 

P5music

unread,
Jul 5, 2021, 11:38:13 AM7/5/21
to CodenameOne Discussions
No, it does not work as well.
I would like to know if it is possible that I altered something in my project inadvertently, like changing from Debug to Release somewhere.
It is something that happens only with the CN1 app, opening the snapshot project as created by maven.
Is it also possible that the maven script has a bug in it, so its last version that runs now, causes absent logging, or set the project to Release?
Regards

Shai Almog

unread,
Jul 5, 2021, 10:04:26 PM7/5/21
to CodenameOne Discussions
Release should still print logging.
I don't see any change in the native code with the latest maven release so I don't think that's possible.

P5music

unread,
Jul 7, 2021, 6:21:47 AM7/7/21
to CodenameOne Discussions

P5music

unread,
Jul 8, 2021, 5:53:58 AM7/8/21
to CodenameOne Discussions
It is worth noticing that I have to manually change that every time maven creates a snapshot and the application is run on the iOS simulator. 
It was not so before, so maybe something has changed in the maven script and now the default in the created project is the other screen, not the console output.
I do not know if it happens for everyone but I guess yes.
However this is not so serious, just if one does not know, the console output seems not producing, because the XCode interface is very similar.
Regards

Reply all
Reply to author
Forward
0 new messages