g_log_set_handler not working with GNOME libs?



I'm working on Java-GNOME, and am having problems trapping the errors
libgnomeui reports, even though they appear to be reported by the same
g_log_default_handler in glib.  Using the code below, I'm able to trap
glib, gtk, and glade errors, but not GNOME ones.  Any ideas why?  

Two questions:

1.  Is there a way to trap all errors in a single call (something like
g_log_set_default_handler)?  I couldn't find anything in gmessages.c,
and it would be a very useful API for runtimes like Java-GNOME.

2.  The domain names were found by searching Makefiles for G_LOG_DOMAIN
definitions -- is there a better, more documented way to find them?

Thanks for any help!

Tom

      GLogLevelFlags fatal_mask = 
	  G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL |
	  G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL;
      glib_log_handler = g_log_set_handler ("GLib", fatal_mask,
					    java_gnome_log_handler, 
					    (gpointer)env);
      gmodule_log_handler = g_log_set_handler ("GModule", fatal_mask,
					       java_gnome_log_handler, 
					       (gpointer)env);
      gobject_log_handler = g_log_set_handler ("GLib-GObject",
fatal_mask,
					       java_gnome_log_handler, 
					       (gpointer)env);
      gthread_log_handler = g_log_set_handler ("GThread", fatal_mask,
					       java_gnome_log_handler, 
					       (gpointer)env);
      gtk_log_handler = g_log_set_handler ("Gtk", fatal_mask,
					   java_gnome_log_handler, 
					   (gpointer)env);
      gnome_log_handler = g_log_set_handler ("Gnome", fatal_mask,
					     java_gnome_log_handler, 
					     (gpointer)env);
      libgnome_log_handler = g_log_set_handler ("libgnome", fatal_mask,
						java_gnome_log_handler, 
						(gpointer)env);
      gnomeui_log_handler = g_log_set_handler ("GnomeUI", fatal_mask,
					       java_gnome_log_handler, 
					       (gpointer)env);





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