1
0
Fork 0

Tidy up print/debug logging headers (#22969)

This commit is contained in:
Joel Challis 2024-01-27 04:30:29 +00:00 committed by GitHub
parent f2299ee5f8
commit bb71145632
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 49 deletions

View file

@ -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); \
# define dprintf(fmt, ...) \
do { \
if (debug_config.enable) xprintf(fmt, ##__VA_ARGS__); \
} while (0)
# define dprintln(s) \
do { \
if (debug_enable) println(s); \
} 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)