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



commit 7a3dae8431a1d61bc91d4cfd4f5976abdb2f31ad
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]