Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Do you leave your qDebug() when exporting final release build?

I have tons of qDebug() and console.log in my code - all over the place - pretty much every class and activity logs to console so it is easier for me to debug the app (the app does a lot of calculations).

 

In any case, I was wondering if I should comment out all the qDebugs() in C++ and console.log in QML before I export release build or whether those are ignored when signed application runs  on the device.

 

I wonder what is the performance effect if any leaving those in.

 

Thank you!

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 1,157
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Do you leave your qDebug() when exporting final release build?

Short answer... yes, you can safely leave qDebug() calls in your release builds since I believe they are disabled by Qt in a "device-release" build. However, if you have them inside an intensive loop you might want to use #ifdef - #endif blocks around them since even though the user won't see them in the console, the calls could still slow things down if they are called often enough.

 

You might want to try doing a device-profile build to see if they are negatively impacting performance.

 


d3v3l0p3r wrote:

I have tons of qDebug() and console.log in my code - all over the place - pretty much every class and activity logs to console so it is easier for me to debug the app (the app does a lot of calculations).

 

In any case, I was wondering if I should comment out all the qDebugs() in C++ and console.log in QML before I export release build or whether those are ignored when signed application runs  on the device.

 

I wonder what is the performance effect if any leaving those in.

 

Thank you!






Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Do you leave your qDebug() when exporting final release build?

[ Edited ]

Sorry greenmr the documentation says otherwise, I remove all mine after all what purpose can they have in a release?

 

http://developer.blackberry.com/native/documentation/cascades/getting_started/tools/debugging.html

 

More comprehensive thread on the subject...

 

http://supportforums.blackberry.com/t5/Native-Development/Dealing-with-qDebug-in-release-candidate/t...

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Do you leave your qDebug() when exporting final release build?

Thought I'd do a quick check to see if the Momentic/project template updates since that thread have changed anything and they haven't the definitions to suppress are still not in the export release.

 

As per slashkyles posting put them in yourself if you really want to keep your debugging calls in..


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 1,157
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Do you leave your qDebug() when exporting final release build?

My bad.

 

 

No need to apologise though. I'm always glad to be corrected when I'm operating under a misconception. I already have automatic #defines depending on which build type I'm doing (one of them is _DEBUG_) so it looks like I'll be wrapping all those calls in #ifdef - #endif blocks.

 

I can think of at least one case for leaving them in though. If your app catches an error you can attach the error log to it and either save the info in shared storage for later perusal, or automatically email it somewhere for tech support. This can be particularly useful for figuring out what modules were executed just before an error. Just because the user will never see it doesn't mean you don't want to save it. Of course, this applies more to qWarning() and qCritical() than qDebug().

 


BBSJdev wrote:

Sorry greenmr the documentation says otherwise, I remove all mine after all what purpose can they have in a release?

 

http://developer.blackberry.com/native/documentation/cascades/getting_started/tools/debugging.html

 

More comprehensive thread on the subject...

 

http://supportforums.blackberry.com/t5/Native-Development/Dealing-with-qDebug-in-release-candidate/t...

 






Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: Do you leave your qDebug() when exporting final release build?

Does that mean if I buy your app it's going to fill up my flash with error logs! Smiley Happy


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 1,157
Registered: ‎03-20-2013
My Device: Red LE Developer Z10
My Carrier: Fido

Re: Do you leave your qDebug() when exporting final release build?

Haha. Nope, I just said I could think of a reason, not that I implemented it. multiFEED doesn't save logs and it doesn't phone home.

 


BBSJdev wrote:

Does that mean if I buy your app it's going to fill up my flash with error logs! Smiley Happy






Developer of Built for BlackBerry certified multiFEED RSS/Atom feed reader and aggregator.  multiFEED Icon

Play nice: Clicking Like Button on posts that helped you not only encourages others to continue sharing their experience, but also improves your own rating on this board. Also, don't forget to accept a post if it solves your problem or answers your question.