1

I'm printing the messages on console in qmomentics ide.

console.log("Simple string message"); 

Then this message is displaying on the device log console.

Now i'm trying to concatenate the other datatypes to the message and printing those messages on the device console. Then that message is not displaying on the console.

 property bool finished: false
 console.log("String message concatenated with bool value" +finished);

Please tell me how print messages which are concatenated with other datatypes.

user2636874
  • 889
  • 4
  • 15
  • 36

3 Answers3

2

Look at this:

NavigationPane {
    id: navigationPane
    property bool myProperty: false //OK
    console.log("my string" + myProperty); //NOT HERE!

    function myFunction() { //OK
    }

    onCreationCompleted: {
        console.log("myProperty: " + myProperty); //THIS WORKS
    }
}

When I try it like you did IDE already gives me an error. Only definitions are allowed there. You can put it in onCreationCompleted or some other function.

Bojan Kogoj
  • 5,321
  • 3
  • 35
  • 57
  • Hi i've given in below function. Then not displaying the message. onOpened: { console.log("Isfinished "+finished); if (finished) { sheetAssplashPage.close(); } } – user2636874 Aug 07 '13 at 09:04
  • I've tried exactly that, it works for me. Check all your names are correct, and any possible errors you get in a console. – Bojan Kogoj Aug 07 '13 at 09:22
0

The correct syntax is console.log("String message concatenated with bool value", finished);

Marc Plano-Lesay
  • 6,808
  • 10
  • 44
  • 75
0

This is likely your answer:

http://devblog.blackberry.com/2012/10/blackberry-10-sdk-console-logging/

You need to install a message handler in order to route the messages to the console.

In your main.cpp file just above the main function, add:

void myMessageOutput(QtMsgType type, const char* msg) {
    fprintf(stdout, "%s\n", msg);
    fflush(stdout);
}

Then inside the main function, add:

qInstallMsgHandler(myMessageOutput);
Jerome C.
  • 46
  • 1
  • 3