Re: [gtkmm] g_log in gtkmm?
- From: Carl Nygard <cjnygard fast net>
- To: Elizabeth Barham <lizzy soggytrousers net>
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] g_log in gtkmm?
- Date: 09 Apr 2003 17:13:30 -0400
On Wed, 2003-04-09 at 16:48, Elizabeth Barham wrote:
> Ole writes:
>
> > Elizabeth writes:
> >
> > > Is there something akin to g_log for gtkmm?
> >
> > Even if you are using gtkmm, you can still access the C functions from
> > Glib by just including the appropriate header. I frequently use
> > g_assert_not_reached().
>
> Hi Ole,
>
> Yes I am aware of those but I was wondering if g_log has a wrapper
> similar to the Gtk+ widgets, such as:
>
> g_log << g_log::debug << "Line " << __LINE__ ;
>
> I do wonder how easy this would be to implement, too. My
> understanding of the glib logging function, plus other debugging
> tools, is that they can be #define'd out:
>
> #ifdef NO_DEBUG
> #define g_log(...)
> #else
> #define g_log(...) g_log(...)
> #endif
>
make g_log an iostream of some sort, I don't know all the ins and outs
of the g_log capabilities, but it's not hard.
You can also create something like cnil, an iostream-derived thingy that
does absolutely nothing. That at least kills the output, but doesn't
remove the stream generation overhead, just doesn't output to terminal
or whatnot.
Then substitute g_log or cnil depending on NO_DEBUG state.
--
Carl Nygard <cjnygard fast net>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]