forked from auracaster/openocd
openocd: don't test 'debug_level' directly
Use the macro 'LOG_LEVEL_IS()' to test 'debug_level'. While there, use the macro 'LOG_LVL_*' in place of the numeric value. Skip all riscv code, as it is going to be updated soon from the external fork. Change-Id: Icad7e879e040d3b9cf1cc004c433f28725017493 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/9070 Tested-by: jenkins
This commit is contained in:
+3
-3
@@ -101,7 +101,7 @@ extern int debug_level;
|
||||
|
||||
#define LOG_DEBUG_IO(expr ...) \
|
||||
do { \
|
||||
if (debug_level >= LOG_LVL_DEBUG_IO) \
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO)) \
|
||||
log_printf_lf(LOG_LVL_DEBUG, \
|
||||
__FILE__, __LINE__, __func__, \
|
||||
expr); \
|
||||
@@ -109,7 +109,7 @@ extern int debug_level;
|
||||
|
||||
#define LOG_DEBUG(expr ...) \
|
||||
do { \
|
||||
if (debug_level >= LOG_LVL_DEBUG) \
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG)) \
|
||||
log_printf_lf(LOG_LVL_DEBUG, \
|
||||
__FILE__, __LINE__, __func__, \
|
||||
expr); \
|
||||
@@ -118,7 +118,7 @@ extern int debug_level;
|
||||
#define LOG_CUSTOM_LEVEL(level, expr ...) \
|
||||
do { \
|
||||
enum log_levels _level = level; \
|
||||
if (debug_level >= _level) \
|
||||
if (LOG_LEVEL_IS(_level)) \
|
||||
log_printf_lf(_level, \
|
||||
__FILE__, __LINE__, __func__, \
|
||||
expr); \
|
||||
|
||||
Reference in New Issue
Block a user