#define LOG_TAG "TDM"
#define TDM_DBG(fmt, args...) \
- if (tdm_debug) \
+ if (tdm_debug < 1) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
} while (0);
#define TDM_INFO(fmt, args...) \
+ if (tdm_debug < 2) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
} while (0);
#define TDM_WRN(fmt, args...) \
+ if (tdm_debug < 3) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
} while (0);
#define TDM_ERR(fmt, args...) \
+ if (tdm_debug < 4) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
#include <time.h>
#define TDM_DBG(fmt, args...) \
- if (tdm_debug) \
+ if (tdm_debug < 1) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
} while (0);
#define TDM_INFO(fmt, args...) \
+ if (tdm_debug < 2) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
} while (0);
#define TDM_WRN(fmt, args...) \
+ if (tdm_debug < 3) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
} while (0);
#define TDM_ERR(fmt, args...) \
+ if (tdm_debug < 4) \
do { \
struct timespec ts; \
clock_gettime(CLOCK_MONOTONIC, &ts); \
#define SUFFIX_MODULE ".so"
#define DEFAULT_MODULE "libtdm-default"SUFFIX_MODULE
-int tdm_debug;
+int tdm_debug = 2;
static tdm_private_display *g_private_display;
static pthread_mutex_t gLock = PTHREAD_MUTEX_INITIALIZER;
}
debug = getenv("TDM_DEBUG");
- if (debug && (strstr(debug, "1")))
- tdm_debug = 1;
+ if (debug)
+ {
+ char buf[64];
+ snprintf (buf, sizeof buf, "%s", debug);
+ tdm_debug = atoi(buf);
+ }
private_display = calloc(1, sizeof(tdm_private_display));
if (!private_display)