Re: PROPOSAL: revise GLib message system



Tim Janik <timj@gtk.org> writes:

> On Fri, 7 Aug 1998, Johannes Keukelaar wrote:
>
> > 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.

#ifdef G_LOGGER_COMPAT
# define g_message_class_new(x)
# define g_warning(x) g_warning(DEFAULT_LOG_CLASS, x)
/* ... */
#endif

 Would solve the problem ?
 You'll probably need an unref function, but apart from that it looks
ok. There are going to be more things that are broken than just
g_warning, some of which are going to have a more complicated fix than
M-x replace-string.

-- 
/* James Antill **WWW**  http://www.and.org/ */ main(){
int h[3][3]={{44680,57949,51424},{60552,41941,18576},{44782,57757,
12000}};int i=-1,j;while(i++<2){j^=j;while(j<3){int k=16;while(
--k>=0)putchar(h[i][j]&(1<<k)?'x':' ');++j;}putchar('\n');}exit(0);}



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