Sunday, 11 August 2013

How to turn off debug log in library

How to turn off debug log in library

I use MediaPlayer to play a mp3 file in my android code. My code is like
this:
MediaPlayer mediaPlayer = null;
try {
Uri fileUri = Uri.parse("File:///XXX/" + word + ".mp3"));
mediaPlayer = MediaPlayer.create(context, fileUri);
mediaPlayer.start();
return 0;
} catch (Exception e) {
//Log.d("ErrorPlayingSound:", word);
return 1;
}
Every time I run this code, it go through without any exception but jumps
out a Logcat info as: "D/MediaPlayer: Couldn't open file on client side,
trying server side", and it plays the audio, and return 0 then.
As a result of this, I can only see a lots of this logs in Logcat and it
is hard to find the debug info I need to notice.
I want to turn off the Log.d info when go to this part and turn on it
after this part. Is there any way to do this?
Thanks ahead!

No comments:

Post a Comment