Re: PROPOSAL: revise GLib message system
- From: johannes nada kth se (Johannes Keukelaar)
- To: gtk-devel-list redhat com
- Subject: Re: PROPOSAL: revise GLib message system
- Date: Mon, 10 Aug 1998 08:58:38 +0200
//On Fri, 7 Aug 1998, Johannes Keukelaar wrote:
//
//> //> ** Gtk+-WARNING: unable to register exit function
//> //>
//> //> ** Gdk-WARNING: shmget failed!
//> //>
//> //> ** GLib-WARNING: trying to realloc freed memory
//>
//> I absolutely agree. Much more useful. However, if you're going to go this
//> way anyway, why not implement this in a more generic way. What I mean is
//> a system where people can register their own message classes, then call
//> g_warning, g_error and all the others with an integer representing this
//> message class, and the proper string would be plugged in in the right
//> place. Say:
//>
//> gint g_message_class_new (gchar *name);
//> void g_warning (gint class, gchar *message);
//>
//> Then you could say:
//>
//> gnome_class = g_messaga_class_new ("Gnome");
//> .....
//> g_warning (gnome_class, "Something went wrong!");
//>
//> You could even extend it to:
//>
//> GWarningFunc g_set_warning_handler (gint class, GWarningFunc func);
//>
//> That way, you can easily select which kinds of messages for which message
//> classes you want to display neat windows for.
//>
//> Perhaps a bit harder to transparently integrate back into all the gtk
//> sources (not really, with global search-replace), and not backwards
//> compatible, but then that was (one of) the idea(s) of the development
//> release, now wasn't it?
//
//what you propose here would have been the best implementation to go for
//in the first place (or at least something similar). but since there is no
//log-level or library-level... associated with any of the g_warning or g_error
//functions out there, this would break *all* existing glib applications in
//*major* ways. this is not accetable.
First of all, this is a development release, which is supposed to be
incompatible, right? Second of all, it is very easy to patch for this in your
sources. (You could even introduce the behaviour that using 0 as class produces
the old behaviour.) Third of all, they could be introduced under new names
(g_logger_*, as suggested by someone else, for example).
Regards,
Johannes.
--
The reason computer chips are so small is computers don't eat much.
<insert funny description here>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]