From bb711456329beda1ab8573fbac3ad51bd398872b Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 27 Jan 2024 04:30:29 +0000 Subject: Tidy up print/debug logging headers (#22969) --- quantum/logging/debug.h | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'quantum/logging/debug.h') diff --git a/quantum/logging/debug.h b/quantum/logging/debug.h index 25d57b156b..017f9b9181 100644 --- a/quantum/logging/debug.h +++ b/quantum/logging/debug.h @@ -54,26 +54,14 @@ extern debug_config_t debug_config; * Debug print utils */ #ifndef NO_DEBUG - -# define dprint(s) \ - do { \ - if (debug_enable) print(s); \ - } while (0) -# define dprintln(s) \ - do { \ - if (debug_enable) println(s); \ +# define dprintf(fmt, ...) \ + do { \ + if (debug_config.enable) xprintf(fmt, ##__VA_ARGS__); \ } while (0) -# define dprintf(fmt, ...) \ - do { \ - if (debug_enable) xprintf(fmt, ##__VA_ARGS__); \ - } while (0) -# define dmsg(s) dprintf("%s at %d: %s\n", __FILE__, __LINE__, s) - #else /* NO_DEBUG */ - -# define dprint(s) -# define dprintln(s) # define dprintf(fmt, ...) -# define dmsg(s) - #endif /* NO_DEBUG */ + +#define dprint(s) dprintf(s) +#define dprintln(s) dprintf(s "\r\n") +#define dmsg(s) dprintf("%s at %d: %s\n", __FILE__, __LINE__, s) -- cgit v1.2.3