[gnome-control-center/gbsneto/goa-helper-printerr: 14/14] online-accounts: Print all GLib messages to stderr




commit 0e8835d18c592401717fc29d0d45e850f24bd304
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed May 25 11:17:27 2022 -0300

    online-accounts: Print all GLib messages to stderr
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1864

 panels/online-accounts/gnome-control-center-goa-helper.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/panels/online-accounts/gnome-control-center-goa-helper.c 
b/panels/online-accounts/gnome-control-center-goa-helper.c
index d0e1a478e..1b40c84c9 100644
--- a/panels/online-accounts/gnome-control-center-goa-helper.c
+++ b/panels/online-accounts/gnome-control-center-goa-helper.c
@@ -470,6 +470,16 @@ struct {
   { "show-account", show_account, },
 };
 
+
+static void
+log_handler (const gchar    *domain,
+             GLogLevelFlags  log_level,
+             const gchar    *message,
+             gpointer        user_data)
+{
+  g_printerr ("%s: %s", domain, message);
+}
+
 int
 main (int    argc,
       char **argv)
@@ -483,6 +493,8 @@ main (int    argc,
   if (argc < 2)
     return EXIT_FAILURE;
 
+  g_log_set_default_handler (log_handler, NULL);
+
   for (i = 0; i < G_N_ELEMENTS (commands); i++)
     {
       if (g_strcmp0 (commands[i].command_name, argv[1]) == 0)


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