From 782078cdb25fa9fa4c9e8654f44708356b844ffe Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Mon, 10 Nov 2014 11:45:48 +0100 Subject: Provide a debug option in the example program --- examples/monitor.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples') diff --git a/examples/monitor.c b/examples/monitor.c index 3e99053..0c7155f 100644 --- a/examples/monitor.c +++ b/examples/monitor.c @@ -364,11 +364,13 @@ int main (int argc, char *argv[]) { MateMixerState state; GOptionContext *ctx; + gboolean debug = FALSE; gchar *backend = NULL; gchar *server = NULL; GError *error = NULL; GOptionEntry entries[] = { { "backend", 'b', 0, G_OPTION_ARG_STRING, &backend, "Sound system to use (pulseaudio, alsa, oss, null)", NULL }, + { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "Enable debug", NULL }, { "server", 's', 0, G_OPTION_ARG_STRING, &server, "Sound server address", NULL }, { NULL } }; @@ -386,6 +388,9 @@ int main (int argc, char *argv[]) g_option_context_free (ctx); + if (debug == TRUE) + g_setenv ("G_MESSAGES_DEBUG", "all", FALSE); + /* Initialize the library. * If the function returns FALSE, the library is not usable. */ if (mate_mixer_init () == FALSE) -- cgit v1.2.1