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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 83
Registered: ‎02-05-2012
My Device: PRIV
My Carrier: T-Mobile

qDebug and console.log not working after Dev Alpha OS Restore

Hi,

 

Yesterday evening I had to restore the OS on my Dev Alpha B device (Hung on start screen for hours). Now I don't see any logging messages from qDebug() or console.log using either slog2info or the Device Log screen within momentics.

 

Last log message I see is from 28-Dec-2012 @ 9pm.

 

Any Suggestions? It's kind of hard to debug without any messages.

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: qDebug and console.log not working after Dev Alpha OS Restore

Did you update to the latest firmware after restoring the OS?
Try rebooting the PC - it helped me once when logs stopped working.

Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 83
Registered: ‎02-05-2012
My Device: PRIV
My Carrier: T-Mobile

Re: qDebug and console.log not working after Dev Alpha OS Restore

I have tried restarting my computer and still don't see any messages.

 

When restoring my Dev Alpha I used the latest firmware downloaded from this dev alpha page.

 

Thanks for the suggestion. Any other ideas? Smiley Happy

Developer
Posts: 83
Registered: ‎02-05-2012
My Device: PRIV
My Carrier: T-Mobile

Re: qDebug and console.log not working after Dev Alpha OS Restore

Just a quick note to anyone else who might find themselves in a similar spot. While I have not figured out a solution for this problem, I have a work-around that uses a 'log file' that I can access using the Target File System Navigator. This at least lets me debug my apps.

 

Here are the methods I use (Quick & Dirty, illustrates the idea):

//
// Log to a file since console.log and qDebug are broken
//
bool DebugLogEnabled = false;
const QString LogFile = QDir::currentPath() + "/app/native/assets/log.log";
void DAL::log(QString message){

	if(DebugLogEnabled){
		QFile Log;
		Log.setFileName(LogFile);
		Log.open(QIODevice::Append);
		QDateTime Date = QDateTime::currentDateTime();

		QTextStream OutStream(&Log);
		OutStream << Date.toString() << "  -  " << message << "\n";
		Log.close();
	}
}

//
// Let users enable debug logging from within application
//
void DAL::ToggleDebugLog(){
	if(DebugLogEnabled){
		DebugLogEnabled = false;
	} else {
		DebugLogEnabled = true;
	}
}

 

Developer
Posts: 83
Registered: ‎02-05-2012
My Device: PRIV
My Carrier: T-Mobile

Re: qDebug and console.log not working after Dev Alpha OS Restore

Just wanted to note that after a few days Debug logging from qDebug() and console.log() started appearing again in slog2info. I'm not sure what the root cause was.