[libpeas] Fix error message when popping log hooks fails



commit 977aaa4f70e265f0b50d33a89949a2f5fbbe9062
Author: Garrett Regier <garrettregier gmail com>
Date:   Tue Jun 24 10:49:07 2014 -0700

    Fix error message when popping log hooks fails

 tests/testing-util/testing-util.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tests/testing-util/testing-util.c b/tests/testing-util/testing-util.c
index 8b843a3..d31a8cb 100644
--- a/tests/testing-util/testing-util.c
+++ b/tests/testing-util/testing-util.c
@@ -281,17 +281,19 @@ testing_util_pop_log_hooks (void)
     }
   else if (unhit_hooks->len > 1)
     {
-      /* Use the default log handler directly to avoid recurse complaints */
-      g_log_default_handler (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR,
-                             "Log hooks were not triggered:\n", NULL);
+      GString *msg;
+
+      msg = g_string_new ("Log hooks were not triggered:");
 
       for (i = 0; i < unhit_hooks->len; ++i)
         {
           hook = g_ptr_array_index (unhit_hooks, i);
 
-          g_print ("\t'%s'\n", hook->pattern);
+          g_string_append_printf (msg, "\n\t'%s'", hook->pattern);
         }
 
+      /* Use the default log handler directly to avoid recurse complaints */
+      g_log_default_handler (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, msg->str, NULL);
       abort ();
     }
 


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