BlackBerry 10 Cascades – console.log() and qDebug() output

This snippet of code will allow you to see the output of qDebug and console.log from the Momentics IDE when developing for BlackBerry 10.

First we need to add this function to the main.cpp file:

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

Inside our main() function, add this:

//Message Handler

Now you will be able to see the output in the IDE while debugging your application, make sure to comment the qInstallMsgHandler line before exporting the Release version of your application.