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
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10
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.

Please use plain text.
Developer
Zmey
Posts: 1,507
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

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
Please use plain text.
Developer
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10
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? :smileyhappy:

Please use plain text.
Developer
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10
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;
	}
}

 

Please use plain text.
Developer
i68040
Posts: 59
Registered: ‎02-05-2012
My Device: Q10
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.

Please use plain text.