GNOME Bugzilla – Bug 578114
API: add two new log levels: FIXME and MEMDUMP
Last modified: 2009-04-16 23:25:12 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: ---------------------------------------------------------------------------
Created attachment 132173 [details] [review] patch: add FIXME and DUMPMEM log levels
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.
> 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.
I like both new log levels and would also use them :)
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
*** Bug 440389 has been marked as a duplicate of this bug. ***