How to set log level in glib

Is there a way to change the log level in glib, for example, in the version version of the application, g_debug debugging messages will not be logged in stdout? Do I really need to implement my own log handler for this (g_log_set_handler)?

+4
source share
1 answer

I asked this question recently. However, everything has changed in the new version of glib that I just discovered.

Since the debug messages of glib version 2.32 are disabled and are not displayed by default. If you want to include them in an environment variable, then G_MESSAGES_DEBUG must be set for everyone.

G_MESSAGES_DEBUG=all /path/to/application 

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

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

+12
source

Source: https://habr.com/ru/post/1338765/


All Articles