From 6389c5fd90b546604bbe47da93527835d9ca91ea Mon Sep 17 00:00:00 2001 From: Frank Schmirler Date: Mon, 21 May 2012 00:37:41 +0200 Subject: [PATCH] Added CLOCK_MONOTONIC timestamp and thread id to Dprintf --- HISTORY | 1 + common.h | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index 8e6a5cd..a075a46 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,7 @@ VDR Plugin 'streamdev' Revision History --------------------------------------- +- Added CLOCK_MONOTONIC timestamp and thread id to Dprintf - Silenced warning (thanks to Rolf Ahrenberg) - Updated Finnish translation (thanks to Rolf Ahrenberg) - Replaced server-side suspend modes with priority based precedence handling diff --git a/common.h b/common.h index 45f99c4..cad48ce 100644 --- a/common.h +++ b/common.h @@ -17,10 +17,16 @@ #include "tools/socket.h" #ifdef DEBUG -# include -# define Dprintf(x...) fprintf(stderr, x) +#include +#include +#define Dprintf(fmt, x...) {\ + struct timespec ts;\ + clock_gettime(CLOCK_MONOTONIC, &ts);\ + fprintf(stderr, "%ld.%.3ld [%d] "fmt,\ + ts.tv_sec, ts.tv_nsec / 1000000, cThread::ThreadId(), ##x);\ +} #else -# define Dprintf(x...) +#define Dprintf(x...) #endif #if APIVERSNUM >= 10714