Complete the g_log() family. (#135730, Sven Herzberg)
authorMatthias Clasen <maclas@gmx.de>
Mon, 5 Jul 2004 22:52:06 +0000 (22:52 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 5 Jul 2004 22:52:06 +0000 (22:52 +0000)
Mon Jul  5 18:50:27 2004  Matthias Clasen  <maclas@gmx.de>

* glib/gmessages.h (g_debug): Complete the g_log()
family.  (#135730, Sven Herzberg)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/glib/glib-sections.txt
docs/reference/glib/tmpl/messages.sgml
glib/gmessages.h

index abcab46..fd94f5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jul  5 18:50:27 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h (g_debug): Complete the g_log() 
+       family.  (#135730, Sven Herzberg)
+
 Mon Jul  5 18:42:30 2004  Matthias Clasen  <maclas@gmx.de>
 
        * glib/gnulib/Makefile.am (INCLUDES): Add top_srcdir to 
index abcab46..fd94f5c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul  5 18:50:27 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h (g_debug): Complete the g_log() 
+       family.  (#135730, Sven Herzberg)
+
 Mon Jul  5 18:42:30 2004  Matthias Clasen  <maclas@gmx.de>
 
        * glib/gnulib/Makefile.am (INCLUDES): Add top_srcdir to 
index abcab46..fd94f5c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul  5 18:50:27 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h (g_debug): Complete the g_log() 
+       family.  (#135730, Sven Herzberg)
+
 Mon Jul  5 18:42:30 2004  Matthias Clasen  <maclas@gmx.de>
 
        * glib/gnulib/Makefile.am (INCLUDES): Add top_srcdir to 
index abcab46..fd94f5c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul  5 18:50:27 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h (g_debug): Complete the g_log() 
+       family.  (#135730, Sven Herzberg)
+
 Mon Jul  5 18:42:30 2004  Matthias Clasen  <maclas@gmx.de>
 
        * glib/gnulib/Makefile.am (INCLUDES): Add top_srcdir to 
index abcab46..fd94f5c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul  5 18:50:27 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h (g_debug): Complete the g_log() 
+       family.  (#135730, Sven Herzberg)
+
 Mon Jul  5 18:42:30 2004  Matthias Clasen  <maclas@gmx.de>
 
        * glib/gnulib/Makefile.am (INCLUDES): Add top_srcdir to 
index 176a324..d36fd42 100644 (file)
@@ -1,3 +1,8 @@
+Mon Jul  5 18:49:56 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/tmpl/messages.sgml: 
+       * glib/glib-sections.txt: Add g_debug.
+
 2004-06-15  Federico Mena Quintero  <federico@ximian.com>
 
        * glib/tmpl/conversions.sgml: New section on file name encodings.
index b75c69e..30046a9 100644 (file)
@@ -840,6 +840,7 @@ g_message
 g_warning
 g_critical
 g_error
+g_debug
 
 <SUBSECTION>
 g_log_set_handler
index 45b0c75..9af18fc 100644 (file)
@@ -121,6 +121,13 @@ A convenience function/macro to log a warning message.
 @...: format string, followed by parameters to insert into the format string (as with <function>printf()</function>)
 
 
+<!-- ##### MACRO g_debug ##### -->
+<para>
+A convenience function/macro to log a debug message.
+</para>
+
+@...: format string, followed by parameters to insert into the format string (as with <function>printf()</function>)
+
 <!-- ##### MACRO g_critical ##### -->
 <para>
 Logs a "critical warning" (#G_LOG_LEVEL_CRITICAL). It's more or less
index f3946ff..d47fdcf 100644 (file)
@@ -123,6 +123,9 @@ void        _g_log_fallback_handler (const gchar   *log_domain,
 #define g_warning(...)  g_log (G_LOG_DOMAIN,         \
                                G_LOG_LEVEL_WARNING,  \
                                __VA_ARGS__)
+#define g_debug(...)    g_log (G_LOG_DOMAIN,         \
+                               G_LOG_LEVEL_DEBUG,    \
+                               __VA_ARGS__)
 #elif defined(G_HAVE_GNUC_VARARGS)
 #define g_error(format...)      g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_ERROR,    \
@@ -136,6 +139,9 @@ void        _g_log_fallback_handler (const gchar   *log_domain,
 #define g_warning(format...)    g_log (G_LOG_DOMAIN,         \
                                        G_LOG_LEVEL_WARNING,  \
                                        format)
+#define g_debug(format...)      g_log (G_LOG_DOMAIN,         \
+                                       G_LOG_LEVEL_WARNING,  \
+                                       format)
 #else   /* no varargs macros */
 static void
 g_error (const gchar *format,
@@ -173,6 +179,15 @@ g_warning (const gchar *format,
   g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, args);
   va_end (args);
 }
+static void
+g_debug (const gchar *format,
+         ...)
+{
+  va_list args;
+  va_start (args, format);
+  g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
+  va_end (args);
+}
 #endif  /* !__GNUC__ */
 
 typedef void    (*GPrintFunc)           (const gchar    *string);