[gedit/wip/improve-debug: 3/3] debug: simplify gedit_debug()



commit 7bea7f0ef93ed4ece456f5e8aa981195ecfffc54
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat May 2 16:57:05 2015 +0200

    debug: simplify gedit_debug()
    
    The only difference is that a trailing space will be printed. It
    shouldn't be a big deal for debug messages.

 gedit/gedit-debug.c |   27 ++++++---------------------
 1 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/gedit/gedit-debug.c b/gedit/gedit-debug.c
index cc94792..396dc14 100644
--- a/gedit/gedit-debug.c
+++ b/gedit/gedit-debug.c
@@ -125,28 +125,13 @@ out:
  * If @section is enabled, then logs the trace information @file, @line, and
  * @function.
  */
-void gedit_debug (GeditDebugSection  section,
-                 const gchar       *file,
-                 gint               line,
-                 const gchar       *function)
+void
+gedit_debug (GeditDebugSection  section,
+            const gchar       *file,
+            gint               line,
+            const gchar       *function)
 {
-       if (G_UNLIKELY (DEBUG_IS_ENABLED (section)))
-       {
-#ifdef ENABLE_PROFILING
-               gdouble seconds;
-
-               g_return_if_fail (timer != NULL);
-
-               seconds = g_timer_elapsed (timer, NULL);
-               g_print ("[%f (%f)] %s:%d (%s)\n",
-                        seconds, seconds - last_time, file, line, function);
-               last_time = seconds;
-#else
-               g_print ("%s:%d (%s)\n", file, line, function);
-#endif
-
-               fflush (stdout);
-       }
+       gedit_debug_message (section, file, line, function, "%s", "");
 }
 
 /**


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