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
Highlighted
New Developer
Posts: 11
Registered: ‎09-29-2012
My Device: 9900
My Carrier: *

qDebug() and console.log()

In release notes of 10.2 SDK Gold it says:

 

"Now, your debug messages using qDebug() and console.log() display directly in the console."

 

This has been going back and forth numerous times.

 

Please BlackBerry let us know how to get the qDebug() and console.log() messages back to Device Log !

Pleaes make the Device Log a separte view in Eclipse !

We need the super useful Filter and Search !

 

Also please write a dedicated section in documentation for this never ending issue. The current doc is inconsistent with release notes. Please also EXACTLY document how to avoid runtime excessive logging and completely shut it off at runtime.

 

New Developer
Posts: 11
Registered: ‎09-29-2012
My Device: 9900
My Carrier: *

Re: qDebug() and console.log()

Hi Folks,

 

It is unfortunately that to develop for BlackBerry 10 we have to dig into this basic service. And do it again and again forever.

 

Any way, if you are bothered, here is a workaround for 10.2.

 

Add the following line at the beginning of your main.c

 

qInstallMsgHandler(0);

 

It sends messages of qDebug() and console.log() back to Device Log where you can use the nice Filter and Search.

 

I don't think the issue is resolved. Someone in BlackBerry please follow up and nail this down before developers esclate and rant.

 

 

 

New Developer
Posts: 11
Registered: ‎09-29-2012
My Device: 9900
My Carrier: *

Re: qDebug() and console.log()

Because BB never had a clear document about debugging and logging, especially in release version at runtime. So I would suggest remove the following line in the final release build you submit to App World.

 

// qInstallMsgHandler(0);

 

Please don't forget this unless BB replies and suggests other way.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: qDebug() and console.log()

Does that line (uncommented) send things to the slog2 facility? If so, commenting it out and allowing the log messages to go back to the logs/log file (which at least formerly was where stdout and stderr were redirected) is likely the wrong thing to do, at least if you have any significant quantity of log messages still going out. That will increase the load on the flash filesystem (wearing it out faster) and increase power consumption, and probably slow down your app and overall system response (not saying by how much... it might not be noticeable, but that wouldn't invalidate my point).

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!