Complete the g_log() family. (#135730, Sven Herzberg)

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)
This commit is contained in:
Matthias Clasen 2004-07-05 22:52:06 +00:00 committed by Matthias Clasen
parent eff7b0c9f2
commit 45306c3a01
9 changed files with 53 additions and 0 deletions

View 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

View 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

View 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

View 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

View 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

View 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.

View File

@ -840,6 +840,7 @@ g_message
g_warning
g_critical
g_error
g_debug
<SUBSECTION>
g_log_set_handler

View 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

View 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);