After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578114 - API: add two new log levels: FIXME and MEMDUMP
API: add two new log levels: FIXME and MEMDUMP
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 440389 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-06 08:51 UTC by Tim-Philipp Müller
Modified: 2009-04-16 23:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch: add FIXME and DUMPMEM log levels (23.14 KB, patch)
2009-04-06 08:52 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2009-04-06 08:51:06 UTC
I'd like to add two new log levels and associated macros to the debugging system, namely GST_FIXME() and friends and GST_MEMDUMP() and friends.

The FIXME category is nothing special and works just like all the other levels.

The MEMDUMP stuff works a bit differently in that it takes a non-printf style message string and data/length arguments and then produces something like this:

---------------------------------------------------------------------------
check gst/gstinfo.c:210:info_dump_mem: quicktime header
check gst/gstinfo.c:210:info_dump_mem: 00000000: 00 00 00 20 66 74 79 70 71 74 20 20 20 05 03 00  ... ftypqt   ...
check gst/gstinfo.c:210:info_dump_mem: 00000010: 71 74 20 20 00 00 00 00 00 00 00 00 00 00 00 00  qt  ............
check gst/gstinfo.c:210:info_dump_mem: 00000020: 00 00 ef e1 6d 6f 6f 76 00 00 00 6c 6d 76 68 64  ....moov...lmvhd
check gst/gstinfo.c:210:info_dump_mem: 00000030: 00 00 00 00 bf d1 00 1d bf d1 00 1e 00 00 0b b5  ................
check gst/gstinfo.c:210:info_dump_mem: 00000040: 00 04 59 c5 00 01 00 00 00 ff 00 00 00 00 00 00  ..Y.............
check gst/gstinfo.c:210:info_dump_mem: 00000050: 00 00 00 00 00 01 25 73 25 73                    ......%s%s      
check gst/gstinfo.c:210:info_dump_mem: ---------------------------------------------------------------------------
Comment 1 Tim-Philipp Müller 2009-04-06 08:52:32 UTC
Created attachment 132173 [details] [review]
patch: add FIXME and DUMPMEM log levels
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2009-04-06 19:57:18 UTC
I like the MEMDUMP category. It also fits nicely below LOG. I am not fully convinced about FIXME though. The main benefit I can see is that once can easily grep the code for those. But I see a FIXME that is hit during execution more on the GST_WARNING level.
Comment 3 Tim-Philipp Müller 2009-04-06 20:29:44 UTC
> I am not fully convinced about FIXME though. The main benefit I can see
> is that once can easily grep the code for those. But I see a FIXME that
> is hit during execution more on the GST_WARNING level.

Not sure, they're semantically different really. A FIXME doesn't necessarily mean a WARNING, e.g. "FIXME: extract image tag". I see it more as a development tool really. We'll never know how useful it is until we have it, and some people swear by it. I'm not particularly attached to it, but I could see myself using it. The debug level isn't ideal of course, but since there's no space between WARNING and INFO we'll just have to add it after log for now.
Comment 4 Sebastian Dröge (slomo) 2009-04-07 07:59:16 UTC
I like both new log levels and would also use them :)
Comment 5 Tim-Philipp Müller 2009-04-08 20:43:29 UTC
Ok, committed with a small change: I moved the MEMDUMP log level to value 9, so there are now still two free log levels between FIXME and MEMDUMP, in case someone comes up with something else.


 commit 116c8be6bfaac6c16a32e6b59949ebb085f1321b
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Mon Apr 6 01:27:26 2009 +0100

    API: add FIXME and DUMPMEM log levels and convenience macros
    
    Two new log levels to dump FIXMEs into the log and to log data
    in form of a hex dump (#578114).
    
    API: GST_CAT_FIXME_OBJECT
    API: GST_CAT_MEMDUMP_OBJECT
    API: GST_CAT_FIXME
    API: GST_CAT_MEMDUMP
    API: GST_FIXME_OBJECT
    API: GST_MEMDUMP_OBJECT
    API: GST_FIXME
    API: GST_MEMDUMP

Comment 6 Tim-Philipp Müller 2009-04-16 23:25:12 UTC
*** Bug 440389 has been marked as a duplicate of this bug. ***