How can I set the log level in glib
Asked Answered
M

1

10

Is there a way to change the log level in glib so e.g. in a release version of an application the debug messages of g_debug won't be logged to the stdout? Do I really need to implement my own log handler for this (g_log_set_handler)?

Montez answered 7/2, 2011 at 20:23 Comment(1)
A log handler can be a really simple function. I don't see why this is a big deal.Bourbon
M
22

I have asked this question quite a while ago. However things have changed in newer glib version which I just have discovered.

Since glib version 2.32 debug messages are disabled and not shown by default. If you want to turn them on the environment variable G_MESSAGES_DEBUG needs to be set to all.

G_MESSAGES_DEBUG=all /path/to/application

This option might be suitable for you and there is no need for a log handler.

See details http://developer.gnome.org/glib/2.32/glib-running.html

Montez answered 20/10, 2012 at 13:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.