No subject


Sun Feb 20 09:24:37 PST 2011


r-gstinfo.html#id2966328 ). It requires 3 lines of code and you are at a point 
where you have printf-style debug output that you can granularly enable and 
disable via command line parameters, environment variables or your own code. I 
have debugged the pixbuf loader in gedit and other apps that way. You can ven 
write custom handlers to transfer debugging output to other places than stderr, 
which was intended for logs in server apps (like fluendo) or visualizing 
debugging in gst-editor.
Most people write more lines of code for a stupid printf debugging that has to 
be enabled via editing source files. You can still find stuff like this in 
places in GStremaers plugins:
//#define ENABLE_DEBUG
#ifdef ENABLE_DEBUG
#define DEBUG printf
#else
#define DEBUG(...)
#endif

Now why am I telling you all this? Because I wanted to show how elegant the 
debugging system is. Maybe the implementation of the debugging system is not 
elegant, but that's something not more than 5 people will probably ever care 
about. It is nearly always more important to make it elegant to the user than 
to make the code elegant.

And since avoiding GST_CAT_DEFAULT means everybody will have to provide an 
extra category parameter to every single debug statement, it's well worth it.

Benjamin




More information about the gstreamer-devel mailing list