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

@ -1,11 +1,11 @@
#ifdef CLUTTER_ENABLE_PROFILE
#include <stdlib.h>
/* XXX - we need this for g_atexit() */
#define G_DISABLE_DEPRECATION_WARNINGS
#include "clutter-profile.h"
#include <stdlib.h>
UProfContext *_clutter_uprof_context;
static UProfReport *clutter_uprof_report;
@ -287,12 +287,10 @@ _clutter_profile_trace_message (const char *format, ...)
va_list ap;
va_start (ap, format);
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, ap);
_clutter_debug_messagev (format, ap);
va_end (ap);
if (_clutter_uprof_context)
if (_clutter_uprof_context != NULL)
uprof_context_vtrace_message (_clutter_uprof_context, format, ap);
}
#endif