log handlers - when fatal




I'm not sure if this is a bug in GLib or was intentional - 

If you use g_log_set_always_fatal() to set some log levels fatal,
then to set a handler for the particular level, you have to or
it with the G_LOG_FLAG_FATAL, e.g.

   g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL,
               	      glade_log_handler, NULL);

Was that intentional? If so, I need to update the docs, as it took
me a while to figure it out.

I'd guess that it is a bug. If the application wanted to perform
different actions for fatal and non-fatal messages, it could test
the fatal flag in the handler.

Damon



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