diff --git a/base/include/base/printf.h b/base/include/base/printf.h index 3bdb68f597..d3975b1feb 100644 --- a/base/include/base/printf.h +++ b/base/include/base/printf.h @@ -63,21 +63,23 @@ namespace Genode { * otherwise nothing (not even the comma) is appended. */ -/** - * Print debug message with function name - */ -#define PDBG(fmt, ...) \ - Genode::printf("%s: " ESC_DBG fmt ESC_END "\n", \ - __PRETTY_FUNCTION__, ##__VA_ARGS__ ) - /** * Suppress debug messages in release version */ #ifdef GENODE_RELEASE -#undef PDBG -#define PDBG(fmt, ...) +#define DO_PDBG false +#else +#define DO_PDBG true #endif /* GENODE_RELEASE */ +/** + * Print debug message with function name + */ +#define PDBG(fmt, ...) \ + if (DO_PDBG) \ + Genode::printf("%s: " ESC_DBG fmt ESC_END "\n", \ + __PRETTY_FUNCTION__, ##__VA_ARGS__ ) + /** * Print log message */