mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-08 11:38:08 +00:00
common: introduce red_printf_debug
This commit is contained in:
parent
e5b2086eb5
commit
ed77ce6dbf
@ -65,4 +65,14 @@
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define red_printf_debug(debug, 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__ ); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user