[mutter/meego-1.0: 16/30] Use glib message functions for logging



commit af218def2e9a0d31c4aada0939891cf287ba0547
Author: Tomas Frydrych <tf linux intel com>
Date:   Wed Mar 17 16:53:41 2010 +0000

    Use glib message functions for logging

 src/core/main.c |    6 +++++-
 src/core/util.c |    6 ++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 0972372..1638c33 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -114,6 +114,7 @@ static void prefs_changed_callback (MetaPreference pref,
  * \param message     the message to log
  * \param user_data   arbitrary data (we ignore this)
  */
+#if 0
 static void
 log_handler (const gchar   *log_domain,
              GLogLevelFlags log_level,
@@ -123,6 +124,7 @@ log_handler (const gchar   *log_domain,
   meta_warning ("Log level %d: %s\n", log_level, message);
   meta_print_backtrace ();
 }
+#endif
 
 /**
  * Prints the version notice. This is shown when Mutter is called
@@ -492,11 +494,13 @@ main (int argc, char **argv)
   struct sigaction act;
   sigset_t empty_mask;
   MetaArguments meta_args;
+#if 0
   const gchar *log_domains[] = {
     NULL, G_LOG_DOMAIN, "Gtk", "Gdk", "GLib",
     "Pango", "GLib-GObject", "GThread"
   };
   guint i;
+#endif
   GIOChannel *channel;
   GOptionContext *ctx;
 
@@ -668,7 +672,7 @@ main (int argc, char **argv)
   meta_prefs_add_listener (prefs_changed_callback, NULL);
 
 
-#if 1
+#if 0
 
   for (i=0; i<G_N_ELEMENTS(log_domains); i++)
     g_log_set_handler (log_domains[i],
diff --git a/src/core/util.c b/src/core/util.c
index 6a0d508..080bc63 100644
--- a/src/core/util.c
+++ b/src/core/util.c
@@ -393,6 +393,8 @@ meta_bug (const char *format, ...)
 
   fflush (out);
   
+  g_critical ("%s", str);
+
   g_free (str);
 
   meta_print_backtrace ();
@@ -426,6 +428,8 @@ meta_warning (const char *format, ...)
 
   fflush (out);
   
+  g_warning ("%s", str);
+
   g_free (str);
 }
 
@@ -454,6 +458,8 @@ meta_fatal (const char *format, ...)
 
   fflush (out);
   
+  g_critical ("%s", str);
+
   g_free (str);
 
   meta_exit (META_EXIT_ERROR);



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