How to view the output of log functions like GST_CAT_INFO, GST_DEBUG etc in Android environment? Can I view them in logcat?
Asked
Active
Viewed 1,644 times
2 Answers
1
The log is written to stderr. You can redirect it to a file (2>debug.log) and download it to your computer. There you can just read it using 'less' or 'more'. Alternatively disable the ansi colors (GST_DEBUG_NO_COLOR=1) and use gst-debug-viewer to interactively browse it.

ensonic
- 3,304
- 20
- 31
-
I tried to use command line in adb shell like this: gst-launch-0.10 filesrc location=/mnt/sdcard/test.mp3 !mp3parse !mad !audioconvert !audioflingersink >debug.log. I got the log and it said filesre was not found. It seems that I can not use command line but only android calling to run gstreamer. Is there some way to modify the gstreamer code in android to let me get the log file when I lunch a music or a video in homescreen? – rlbh Jun 07 '12 at 12:57
-
You redirected stdout, but for the debug.log you will need to redirect stderr, that is 2>debug.log. You can write you own log handler (see glib api for that) and also programatically set the loglevels from your applications. This will give you full control. – ensonic Jun 07 '12 at 18:17
-
I tried as what you said, but the log still told me filesrc was not found. It seems that I can not use command line but only android calling to run gstreamer. Anyway, thanks for your answer! – rlbh Jun 11 '12 at 14:11
0
There is a method to redirect stdio to the log so it is visible in logcat:
Redirect stdout to logcat in Android NDK
I have used this several times. I also remount /system read-write on android and edit "/system/build.prop" to add the setting so it survives a reboot. On development platforms, you can even use "vi" within adb shell to edit the file.