01-06-2013 12:13 PM
As we all know, we have had to do some minor fancywork in order to be able to use qDebug and see our output in the console based on the advice here: https://developer.blackberry.com/cascades/download
As we also know, using this method affects the performance of the app.
So, when it comes time to build for Release-Device, do we remove the myMessageOutput function and the qInstallMsgHandler call from main? Or will the #ifndef QT_NO_DEBUG clause make sure performance is not impacted?
Solved! Go to Solution.
01-06-2013 04:17 PM
qDebug() and qWarning() will work in Release build too. QT_NO_DEBUG doesn't affect them.
So to remove logging you'll need to define QT_NO_DEBUG_OUTPUT and QT_NO_WARNING_OUTPUT for the entire project. This will disable default logging function.
When using custom handler you're controlling how the output is printed so check for these macros explicitly if you're using your own logging function.
You might want to check this page for details:
01-06-2013 04:25 PM
01-06-2013 04:55 PM - edited 01-06-2013 04:56 PM
It only attaches the message output function depending on QT_NO_DEBUG. Would I still have to define QT_NO_DEBUG_OUTPUT and QT_NO_WARNING_OUTPUT then?
Yes, you'll need to disable the default ones.
But I'd obviously prefer to only have that there in the Release-Device configuration.
In Qt it can be done like this:
Release: DEFINES += QT_NO_WARNING_OUTPUT QT_NO_DEBUG_OUTPUT
Probably it will work for Cascades too.
Clean all before rebuilding and check the compilation logs to ensure they were applied.
01-06-2013 06:22 PM - edited 01-06-2013 07:02 PM
Thanks guys, I'll get back to you about whether that worked or not. For now, I am unable to run my app when in Release mode... I have a thread about that if you think you can help out (second post): http://supportforums.blackberry.com/t5/Cascades-De
EDIT: Alright fixed the issue and now I've tested it and I see that nothing is being outputted. Looks to be perfect. I ran slog2info and saw absolutely nothing being outputted while in Release mode, while everything under the sun was being printed in Debug mode.
Oh, one more question: Does this mean it's safe to leave qDebug and console.logs in the code? Or is it still a good idea to comment those out anyway?
08-01-2013 08:09 AM
have you checked these already? They are kind of old but I guess they are still valuable.
Basically, there's no overhead of qDebug() function execution. The info is a bit old but I guess it's still valid. I use it on my apps and it works.
08-04-2013 08:37 AM