01-09-2013 10:18 PM
Hi,
I am trying to get the Debug messages in the Console,I tried Like
qDebug()<<"Demo App>>>>>>>>>>>>>>>>" ;
and in console I am searched for the output as given below
Whether it Works because I came across the KB article
http://supportforums.blackberry.com/t5/tkb/article
What is present solution?
Thanks
Rakesh Shankar
01-09-2013 10:23 PM
I use:
std::cout << "some text << std::endl;
If you do this, don't forget to
#include <iostream>
01-09-2013 10:36 PM
lots of threads on this subject already.
http://supportforums.blackberry.com/t5/Cascades-De
01-10-2013 04:37 AM
Hi,
qDebug() can't reach the console window of Momentics IDE by own. You must create a message handler, who will transfer qDebug() messages to the console. The easiest way is, to copy this method to your main.cpp file:
void myMessageOutput(QtMsgType type, const char *msg)
{
//in this function, you can write the message to any stream!
switch (type) {
case QtDebugMsg:
fprintf(stderr, "Debug: %s\n", msg);
break;
case QtWarningMsg:
fprintf(stderr, "Warning: %s\n", msg);
break;
case QtCriticalMsg:
fprintf(stderr, "Critical: %s\n", msg);
break;
case QtFatalMsg:
fprintf(stderr, "Fatal: %s\n", msg);
abort();
}
}This will be the debug message handler. One thing is left: you must install this message handler for your application. Copy to the main() method this line of code right after the translator initialization:
qInstallMsgHandler(myMessageOutput);
cheers,
chriske
01-10-2013 10:13 AM
Please do not ship final apps with this stdour/stderr logging enabled. It causes a performance hit because stdout/stderr are written to the flash disk while apps are running.
Consider only calling qInstallMsgHandler() in an #ifdef DEBIG condition or similar.
Cheers,
Sean
01-10-2013 10:28 AM - edited 01-10-2013 10:49 AM
I have a check to avoid executing the statements, but you're right, I should have mentioned that