Re: [PATCH] g_log_set/remove_handler





>From: Tim Janik <timj@gtk.org>
>To: Gady Kozma <gadykozma@hotmail.com>
>Subject: Re: [PATCH] g_log_set/remove_handler
>Date: Mon, 7 Aug 2000 12:42:47 +0200 (CEST)
>
>On Mon, 7 Aug 2000, Gady Kozma wrote:
>
> >
> > >i don't see how this is useful, the function has _set_ semantics rather
> > >than _add_ for a reson. installing multiple handlers for the same 
>loglevels
> > >in the same domain is of questionable benefit, and that's the only case
> > >where you'd notice your append vs. the current prepend semantics.
> >
> > Hmpf... My situation is as follows:
> >
> > Executable
> >     |      |     ...
> >     V      V
> >   dll 1   dll 2
> >     |    /
> >     V   V
> >   gts (a dll which logs via g_log)
> >
> > Now, each of the dlls wants control over the output of gts while it is 
>being
> > run, and then to recover whatever previous handler existed. So I would 
>like
> > to have either a recursive g_log_add_handler, or a g_log_get_handler (I
> > didn't see such a function in the docs, maybe I didn't look thoroughly
> > enough)
>
>hm, first g_log_get_handler() will introduce problems as handlers can
>be removed, e.g. if installed by a dynamically loadable code portion
>that gets unloaded again. now imagine after that code is gone you'd
>reinstall its handler-- boom! ;)
>for the above example, g_log_set_handler() should actually give you
>the semantics you want,

I agree

>you can control which handler gets the
>log message by installing the "overriding log handler" later, that's
>what the prepend semantics give you, if you then remove that, log handling
>would fallback to the previously installed one. however, that is relying on
>implementation details, so if you really have to rely on this, we might
>want to document that "detail" to ensure it's maintained through future
>glib changes.

Yes, I really have to rely on this. So yes, documenting this detail would be 
nice.

>let me know why you think the current behaviour still needs changing,
>maybe i'm missing part of your requirements, but please keep the
>discussion public, so i'd apprechiate a full quote back to gtk-devel-list 
>;)
>
> >
> > >note, btw, that your patch creates a circular list if handlers
> > >are already installed:
> >
> > Yes, I'm sorry, I only noticed it after I sent the mail...
> >
>
>---
>ciaoTJ
>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com





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