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
Developer
Posts: 132
Registered: ‎11-20-2009
My Device: Not Specified

Output to log/console

Sorry if this is a silly question.... but how do I show debug messages to console?

 

I am quite confused about how I can accomplish this... thanks Smiley Happy

 

 

Developer
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10
My Carrier: Free mobile

Re: Output to log/console

a simple printf will work

Highlighted
Developer
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10
My Carrier: Free mobile

Re: Output to log/console

[ Edited ]

.

 

 

Developer
Posts: 100
Registered: ‎10-01-2012
My Device: BB10 Dev Alpha
My Carrier: Roger

Re: Output to log/console

qDebug() << "your message";

 

  • 1. In the IDE, in the Target Navigator view, right-click the device target. Click Launch SSH Session. 
  • 2. In the terminal that appears, do one of the following:      
    • a. To view the current slogger2 logs, type slog2info.      
    • b. To view real-time output for the processes that are being debugged (for applications that are running in development mode), typeslog2info -w.      
    • c. To view help information on slogger2, type slog2info -h.
    • slog2info -w |grep qt-msg   (filer the message)

 

Developer
Posts: 163
Registered: ‎04-28-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

Re: Output to log/console

HI,

 

     Follow the below link this will help u.

     https://developer.blackberry.com/cascades/documentation/dev/upgrading/momenticschanges.html

 

Regards,

Naresh Kodumuri.

 

Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: Output to log/console

Hi,

 

Check this link.. This is a great solution...

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 217
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: Output to log/console

The workaround from the link below works like a charm for me.

 

http://supportforums.blackberry.com/t5/Cascades-Development/Workaround-Debug-messages-to-Console/m-p...

 

I have been told that this is only a temporary problem which will be fixed in the next release of the SDK.

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

Re: Output to log/console

It's worth pointing out that using the qInstallMsgHandler() approach probably slows down your app, and is otherwise more heavy on resources than the slogger2 approach which now appears standard.

Among the advantages of the slogger2 approach:

1. Writes to RAM disk (/dev/shmem/slogger2) so it's much faster in that respect and saves wear and tear on the flash storage.

2. Less impact on CPU load.

3. Reduced latency compared to what is probably a relatively heavy hit from the fflush() calls.

4. Output persists between invocations of the app, so you don't risk losing the output after a crash when you re-start the application.

5. Can probably leave your logging code in place even in production builds (as a result of all these things).

6. Built-in timestamping (to the millisecond).

7. "slog2info -w" provides continuous output across invocations, whereas "tail -f" has to be restarted with each launch. (This advantage is mainly for those who would manually do "tail -f logs/log" via SSH. Momentics basically does that for you.)

8. Easier combined log output when running two connected apps while testing Invocation Framework code.

There are probably other advantages. My point is, at least consider switching rather than unthinkingly sticking with the old console output just because it's more familiar to you.

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!