Why am I not seeing println statements?

function initialize() {
    View.initialize();
    System.println("initialise");
}

As I see it, the above code should be pretty uncontroversial apart from the z vs e spelling!

So why am I not seeing anything in the console when running the simulator (Version 7.1.1)?

Is this a bug that everyone else is seeing or has something changed that I missed the memo for? 

  • Ok, update to this. 

    It happens on one specific project.

    I've just checked another project, running on same device, and System.println() works.

    So...

    Anybody have any idea why System.println might fail for one specific project (for a widget, as it happens)?

  • Only difference I see when doing a code compare is that in one I was using "import " and in the other I was using "using " to import classes. I've swapped them and that makes... no difference whatsoever. :(

  • Ok, I simply created a new file and copied the code and resources across... Suddenly, .println worked in the copied folder. Still not in the original.

    I am guessing this is something more to do with VSCode than CIQ, I remain none the wiser as to what, but at least I can debug.

  • In the original project folder, it could be that the simulator was somehow running an old version of the app PRG that was built before you added the println statement. I’ve seen that kind of problem before.

    If you’re curious, you can try:

    - checking the bin/ folder in your original project folder, to make sure there’s no extra PRGs somehow

    - deleting (or moving away) all PRGs in the simulator’s GARMIN\APPS folder, and seeing if the problem persists

    The simulator root folder is here (the folder structure mirrors that of a real device):

    Windows: %TEMP%\com.garmin.connectiq\GARMIN

    Mac: $TMPDIR/com.garmin.connectiq/GARMIN

  • A possible cause is the Filter box in VSCode. If you enter something into this box it only displays System.println output that matches, which will often be nothing. It is easy to accidentally add a filter, by e.g., having keyboard focus in the DEBUG CONSOLE, and typing CTRL-F string, thinking you will be searching in the code, but "string" goes into the filter box, and your System.println output disappears. 

  • When this happens to me, it is always the filter box in the debug console.