Re: Proposal for 2.8: Glog



Does this library only support logging of text messages, or is
it also possible to log other type of data? Here is an example
what I would like to have:

    << start of log >>
    12:00:00  Starting algo loop            # <-- A rich text message
    12:10:01  <image/png>: Video snapshot   # <- mime/type and message

              +----------------+
              |                |
              |                |
              |  Image         |
              |                |
              +----------------+

    12:10:00 Saturation: No                 # <-- A table with textmessage
             Max GL:     230
    12:10:01 <graph/svg>: Projection on x-axis   # <-- Another mimetype

              ^
              |
              |         /\
              | /\     /  \
              |/  \___/    \
              +--------------->

    :
    << end of log >>
              
Of course you would employ some filter in order to view
such a log under different technologies. E.g. in a console you 
cannot see the images and the graphs. In a browser window you
would see all graphic contents and links to non-graphics contents,
like e.g. audio.
              
I tend to debug various iterative algorithms, and having a facility
like what is described here, would help me a lot.

Regards,
Dov

On Tue, May 03, 2005 at 09:03:05PM +0200, Maciej Katafiasz wrote:
> Hi hackers,
> 
> here's a proposal for addition to Glib 2.8, named Glog.
> Bunch of details:
> 
> What is it?
> -----------
> 
> Glog is debugging and logging library. It provides simple, but flexible
> logging facilities, with support for multiple logging levels, and allows
> to precisely specify the output to be shown. Its output can be coloured,
> and logging messages can be sorted by different categories for use by
> separate pieces of code.
> 
> Glog depends only on Glib, and has no other dependencies (besides usual
> GNU toolchain). Optionally it can make use of glibc's printf()
> extensions.
> 
> How mature is it?
> -----------------
> 
> Very. The library itself is 2 months old, but the entirety of code was
> taken from GStreamer, where it has been used *extensively* for years. It
> is the very basic tool used by gstreamer team for debugging purposes,
> and works great in this role.
> It is very small and self-contained, has very little impact on existing
> code (none in fact, if you don't use it explicitly), adds only minimal
> API and integrates with Glib out of the box. Glog compiles everywhere
> where GStreamer does, which is (AFAIK) everywhere where Glib compiles,
> including win32, osx, and weirdarse unices you'd rather forget about. It
> also builds natively under MSVC on win32.
> We feel that logging support provided by Glog is mature and of immense
> usefulness for much broader class of applications than just GStreamer,
> hence this proposal.
> 
> Whole libification was done by Benjamin Otte of GStreamer fame, to whom
> the credit goes.
> 
> Who would want to use it?
> -------------------------
> 
> Anyone who is interestend in precise tracking and logging of code
> execution. Glog doesn't directly replace Glib's debugging facilities,
> which are mostly intended for detecting programming errors, but rather
> complements it by providing extensive tools for observing runtime
> behaviour, especially when time domain is of importance, as is the case
> for media processing.
> 
> In short, if you'd use Log4j, you'd also use Glog.
> 
> How performant is it?
> ---------------------
> 
> Enough. Our experience shows that impact is barely noticable, and
> doesn't exceed 5% when logging is turned off. All GStreamer builds sport
> logging support by default, and we're media framework using Glog all
> over the place, so you can get the idea :). When not used the runtime
> penalty is exactly 0% (you need to opt in to use Glog).
> 
> If maximum performance is of concern, Glog can be compiled out with a
> single line, reducing all calls to NOPs.
> 
> Where can I get it?
> -------------------
> 
> cvs -d:pserver:anoncvs pdx freedesktop org:/cvs/gstreamer co
> gst-sandbox/glog
> 
> To see it in action, just run (provided you have GStreamer installed)
> 
> $ gst-inspect-0.8 --gst-debug=*:5
> 
> and watch in awe. To get feel of category support, try
> 
> $ gst-launch-0.8 --gst-debug=GST_STATES:3,GST_PLUGIN_LOADING:5 fakesrc !
> fakesink
> 
> Conclusion
> ----------
> 
> That's about it. GStreamer team will still be maintaining Glog once it's
> incorporated in Glib proper. Total amount of time estimated necessary
> for integration: 2 hours (if it goes bad, all it really takes is copying
> the source and slightly adjusting autofoo).
> 
> Cheers,
> Maciej
> 
> -- 
> Maciej Katafiasz <ml mathrick org>
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]