From af77bb577d21215167d388f908584d797cc3c303 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 6 Nov 2011 16:09:35 +0200 Subject: server: add prefix argument to red_printf_debug printed before function name. No central location for prefixes. Adding "WORKER", "ASYNC", "MAIN" since those were the current users. --- common/spice_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/spice_common.h b/common/spice_common.h index f6205a33..d13a94fd 100644 --- a/common/spice_common.h +++ b/common/spice_common.h @@ -65,13 +65,13 @@ } \ } while (0) -#define red_printf_debug(debug, format, ...) do { \ +#define red_printf_debug(debug, prefix, format, ...) do { \ static int debug_level = -1; \ if (debug_level == -1) { \ debug_level = getenv("SPICE_DEBUG_LEVEL") != NULL ? atoi(getenv("SPICE_DEBUG_LEVEL")) : 0; \ } \ if (debug <= debug_level) { \ - printf("%s: " format "\n", __FUNCTION__, ## __VA_ARGS__ ); \ + printf("%s: %s: " format "\n", prefix, __FUNCTION__, ## __VA_ARGS__ ); \ } \ } while(0) -- cgit