[gst-devel] Cool new debugging feature

Erik Walthinsen omega at temple-baptist.com
Sat Apr 28 08:03:10 CEST 2001


Today I got sufficiently sick of getting lost in the debug output that I
finally implemented colorized markup.  This meant that the DEBUG and INFO
output from libgst.la and the plugins is now very colorful, bordering on
physchedelic <g>

My primary development of this has been in my BRANCH-INCSCHED1 working
copy, but I did port it back down to HEAD at one point.  This means that
the latest and greatest will be in INCSCHED1 for a little while longer.
However, it should be trivial for me to port it back down again because
the entire thing only changes two files: gstinfo.h and gstinfo.c.

Currently (in INCSCHED1), pthread id, cothread id, and function:line are
colorized, based on different things.  pthread and cothread id are simply
the ID modulo 6.  This means that there will likely be collisions.  I
can't think of a good, fast way to at least try to guarantee unique colors
for these, let alone a good way to have more than 6...

The function:line pair is colorized based on a static table in gstinfo.c,
which defines colors for each category.  This means that you can easily
spot anything having to do with plugin loading, since that's all (for the
moment) cyan.  Dataflow is green, etc.  This table is very much in flux
though, so suggestions are welcome.  gstreamer.net/wiki/GstDebugColors has
a table of them, you can put comments there.

I'm going to hvae to change around the DEBUG system to use a function
pointer, just like the INFO system, because otherwise I can't keep the
DEBUG output in sync with the INFO output.  Besides, this allows an even
cooler feature that taaz suggested, which is to simply write debug output
in XML.  This can then be done by replacing the function pointers for
DEBUG and INFO with XML writers instead of these colorized versions.

Those who want a sneak peek can check out the INCSCHED1 branch, otherwise
stick with HEAD for now and wait for a backport, probably tomorrow if I
remember.  Otherwise it'll be probably Monday when INCSCHED1 finally
merges down into HEAD.

A screenshot of the current INCSCHED1 code can be found at:

gstreamer.net/images/color-debug.png

      Erik Walthinsen <omega at temple-baptist.com> - System Administrator
        __
       /  \                GStreamer - The only way to stream!
      |    | M E G A        ***** http://gstreamer.net/ *****
      _\  /_





More information about the gstreamer-devel mailing list