From a3d4d95fb820fc70539601e5988a903275e7162b Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Wed, 11 May 2016 08:06:04 +0200 Subject: [PATCH] Prefix debug messages displayed with _dbus_verbose() with a timestamp. The new format of output generated with dbus_verbose() is : Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95191 --- dbus/dbus-internals.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 134aee2..4171f41 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -394,6 +394,8 @@ _dbus_verbose_real ( va_list args; static dbus_bool_t need_pid = TRUE; int len; + long sec,usec; + _dbus_get_real_time(&sec, &usec); /* things are written a bit oddly here so that * in the non-verbose case we just have the one @@ -409,10 +411,11 @@ _dbus_verbose_real ( #if PTHREAD_IN_VERBOSE fprintf (stderr, "%lu: 0x%lx: ", _dbus_pid_for_log (), _dbus_current_thread_id ()); #else - fprintf (stderr, "%lu:0x%04lx: ", _dbus_pid_for_log (), _dbus_current_thread_id ()); + fprintf (stderr, "%lu:0x%04lx ", _dbus_pid_for_log (), _dbus_current_thread_id ()); #endif } #endif + fprintf (stderr, "%ld.%06ld ", sec, usec); /* Only print pid again if the next line is a new line */ len = strlen (format); -- 1.8.4.5