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
thubalek
Posts: 322
Registered: ‎10-01-2012
My Device: Dev Alpha C, Playbook 32 GB
My Carrier: BleskMobil

NowPlayingConnection and MediaPlayer are flooding log with useless messages

Hello,

 

I'm working on media player and I found extremely difficult to debug is as NowPlayingConnection and MediaPlayer are flooding log with a lot of useless logs.

 

 

Does anybody come with some solution how to turn these messages off?

 

I'm using 

 

slog2info -w | grep -v '=>' | grep -v MmrContextNotifier | grep -v NowPlayingConnectionPrivate | grep -v MediaPlayerPrivate | grep -v 'NowPlayingConnection::setPosition' | grep -v 'MediaPlayer::position' | grep -v 'NowPlayingConnection' 

 

but it far from to be perfect.

 

I would love to see some properties like debugLevel added into NowPlayingConnection and MediaPlayer.

--------------------------------------------------------------------------------------------
-- My Blackberry 10 app at http://blackberry.hubalek.net
-- My Android apps at http://android.hubalek.net
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: NowPlayingConnection and MediaPlayer are flooding log with useless messages

I do something similar with a shell script I put in ~/bin/slog containing this, currently:

 

slog2info -w | sed -re '/default      0 |OrientationSupportPrivate|MediaPlayer|MmrContext|=> END/d;s/^.{7}(\S+) ([^.]+\.[^.]+\.[^.]+)\.\S+\s+(\S+)\s+(.*)/\1 \2 \3 \4/'

 (That's all one line, in case it gets wrapped, and certain spaces are critical so do a straight copy/paste if you use it.)

 

There may be ways to shut it off, but as I believe it's a moving target (what we see with the next version will likely be changed again) I'm not really spending any time thinking about it for now. Just update your filtering as you see fit and carry on... if you type that long command line every time, of course, then that would get annoying. So.. don't. ;-)


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!
Please use plain text.
Developer
HorizonXP
Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: NowPlayingConnection and MediaPlayer are flooding log with useless messages

I have the exact same issue with the Camera QML component. Bit annoying to have your log filled with useless debug messages.

Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: NowPlayingConnection and MediaPlayer are flooding log with useless messages

Might be worth noting that this log *can't* be "filled" (although I know that's not really what HorizonXP meant).

The slog2 output goes into circular buffers in a RAM drive, so it's not only light-weight (no constant rewriting of flash memory) but it doesn't even consume much memory to do it since old messages are just replaced with new ones as you go.

It's an inconvenience only (handled with the above filtering techniques), and probably a temporary one at that.

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!
Please use plain text.
Developer
borceg
Posts: 671
Registered: ‎03-21-2012
My Device: BlackBerry PlayBook 16GB
My Carrier: Vip

Re: NowPlayingConnection and MediaPlayer are flooding log with useless messages

Device log view in Momentics IDE provides selection between various slog2 messages CRITICAL, ERROR, WARNING, DEBUG1, INFO etc (Severity, verbosity, and filtering) but it's not quite polished at this moment. Some changed need to be done in order to distinguish between system messages (in which we are not interested at all) during debug and messages relevant to our code execution.
Please use plain text.
Contributor
pranavjayadev
Posts: 23
Registered: ‎07-31-2012
My Device: 9320
My Carrier: blackberry

Re: NowPlayingConnection and MediaPlayer are flooding log with useless messages

Please use this method for printing logs

 

void mylogs(QtMsgType type, const char *msg)
{
switch (type) {
/* case QtDebugMsg:
fprintf(stderr, "Debug: %s\n", msg);
break;*/
case QtWarningMsg:
fprintf(stderr, "Warning: %s\n", msg);
break;
case QtCriticalMsg:
fprintf(stderr, "Critical: %s\n", msg);
break;
case QtFatalMsg:
fprintf(stderr, "Fatal: %s\n", msg);
abort();
break;
}
}

 

and use 

qCritical()<<"logs" instead of qDebug()<<"logs"

Please use plain text.