From a304b9562b9e941dd18a1d833fb4c35db8b9a1aa Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 21 Feb 2012 19:53:34 +0400 Subject: [PATCH] eitd/debug.h: add color xprint --- src/eitd/debug.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/eitd/debug.h b/src/eitd/debug.h index 76814b79f..b3262b7f1 100644 --- a/src/eitd/debug.h +++ b/src/eitd/debug.h @@ -36,6 +36,14 @@ extern bool sections_debug; #define dputs(str) do { if (sections_debug) { printdate_ms(stdout); puts(str); fflush(stdout); }} while (0) #define xprintf(fmt, args...) do { printdate_ms(stderr); fprintf(stderr, fmt, ## args); } while (0) +/* dont add \n when using this */ +#define xcprintf(fmt, args...) do { \ + fprintf(stderr, "%c[%d;%d;%dm", 0x1B, 1, 31, 40);\ + printdate_ms(stderr); \ + fprintf(stderr, fmt, ## args); \ + fprintf(stderr, "%c[%dm\n", 0x1B, 0); \ +} while (0) + void printdate_ms(FILE* f); void showProfiling( std::string text );