Re: PROPOSAL: revise GLib message system



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.

> 
> Just my 2 cents,
> 
> Johannes.
> 

---
ciaoTJ



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