Rework debug output

Make it consistent across the various build options (with or without
profiling enabled), and add a timestamp using the monotonic clock to
every debug message.
This commit is contained in:
Emmanuele Bassi
2011-11-15 17:39:49 +00:00
parent c6e487a5c1
commit 59f395d856
4 changed files with 54 additions and 39 deletions

View File

@ -3703,3 +3703,29 @@ _clutter_get_sync_to_vblank (void)
{
return clutter_sync_to_vblank;
}
void
_clutter_debug_messagev (const char *format,
va_list var_args)
{
gchar *stamp, *fmt;
stamp = g_strdup_printf ("[%16" G_GINT64_FORMAT "]",
g_get_monotonic_time ());
fmt = g_strconcat (stamp, ":", format, NULL);
g_free (stamp);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, var_args);
g_free (fmt);
}
void
_clutter_debug_message (const char *format, ...)
{
va_list args;
va_start (args, format);
_clutter_debug_messagev (format, args);
va_end (args);
}