[libpeas] Disable log hooks used by PyGobject and Seed



commit f957df40176a8ea1ee4e4a71a07c0a26ad6cbc59
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Sep 18 06:37:09 2011 -0700

    Disable log hooks used by PyGobject and Seed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=648436

 loaders/python/peas-plugin-loader-python.c |    2 ++
 loaders/seed/peas-plugin-loader-seed.c     |   11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index 6a828d7..f29d83c 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -411,6 +411,8 @@ peas_plugin_loader_python_initialize (PeasPluginLoader *loader)
   /* Initialize support for threads */
   pyg_enable_threads ();
 
+  pyg_disable_warning_redirections ();
+
   gi = PyImport_ImportModule ("gi");
   if (gi == NULL)
     {
diff --git a/loaders/seed/peas-plugin-loader-seed.c b/loaders/seed/peas-plugin-loader-seed.c
index ec4f94f..9349571 100644
--- a/loaders/seed/peas-plugin-loader-seed.c
+++ b/loaders/seed/peas-plugin-loader-seed.c
@@ -274,7 +274,16 @@ peas_plugin_loader_seed_init (PeasPluginLoaderSeed *sloader)
    * and is shared among instances (esp wrt module paths), but apparently there
    * is no way to avoid having it shared... */
   if (!seed)
-    seed = seed_init (NULL, NULL);
+    {
+      seed = seed_init (NULL, NULL);
+
+      /* Reverse the log handle Seed uses.
+       * The one place that Seed uses this shouldn't make a
+       * difference.
+       */
+      g_log_set_handler ("GLib-GObject", G_LOG_LEVEL_WARNING,
+                         g_log_default_handler, 0);
+    }
 
   sloader->loaded_plugins = g_hash_table_new_full (g_direct_hash, g_direct_equal,
                                                    NULL,



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