[Geany-devel] GLib 2.32 and debug messages

Colomban Wendling lists.ban at xxxxx
Sat Jun 2 10:58:32 UTC 2012


Hi guys,

Since GLib 2.32, log messages at levels INFO or DEBUG aren't output
unless G_MESSAGES_DEBUG environment variable is set to either "all" or
to include the domain the message comes from [1].

The problem is that it breaks our `-v` option, since we simply turns on
outputting INFO-level messages.  So, we need a fix or a workaround,
something.  I see 2 solutions:

1) simply `g_setenv("G_MESSAGES_DEBUG", "all", TRUE)` when given `-v`
(e.g. around main.c:131, `if (app->debug_mode) g_setenv(...`)

2) output everything ourselves in `handler_log()` (log.c:115) rather
than calling GLib's default handler.


The simplest fix is of course 1.  Not sure which one is the better
though.  Anyway, I think we need to do something about this soon.

Thoughts?

Cheers,
Colomban


[1]
http://developer.gnome.org/glib/unstable/glib-Message-Logging.html#g-log-default-handler


PS: BTW, if I read the `handler_log()` correctly, we block *all*
messages when not in debug mode?  I mean, warnings, criticals and
everything.  Do we really want that?



More information about the Devel mailing list