forked from auracaster/openocd
configure.ac: Replace --enable-verbose-usb-comms with a new runtime log level.
--enable-verbose actually did the same as --enable-verbose-usb-comms, so the new code replaces it too. Change-Id: I1d1ddd5d681009663e0c52a75ad76fe71dbc172a Signed-off-by: R. Diez <rdiez-2006@rd10.de> Reviewed-on: https://review.openocd.org/c/openocd/+/9281 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
* LOG_LVL_INFO - state information, etc.
|
||||
* LOG_LVL_DEBUG - debug statements, execution trace
|
||||
* LOG_LVL_DEBUG_IO - verbose debug, low-level I/O trace
|
||||
* LOG_LVL_DEBUG_USB - verbose USB trace
|
||||
* In the past this corresponded to build configuration options
|
||||
--enable-verbose and --enable-verbose-usb-comms.
|
||||
*/
|
||||
enum log_levels {
|
||||
LOG_LVL_SILENT = -3,
|
||||
@@ -47,6 +50,7 @@ enum log_levels {
|
||||
LOG_LVL_INFO = 2,
|
||||
LOG_LVL_DEBUG = 3,
|
||||
LOG_LVL_DEBUG_IO = 4,
|
||||
LOG_LVL_DEBUG_USB = 5,
|
||||
};
|
||||
|
||||
void log_printf(enum log_levels level, const char *file, unsigned int line,
|
||||
@@ -100,6 +104,8 @@ extern int debug_level;
|
||||
|
||||
#define LOG_LEVEL_IS(FOO) ((debug_level) >= (FOO))
|
||||
|
||||
#define LOG_DEBUG_USB(expr, ...) LOG_CUSTOM_LEVEL(LOG_LVL_DEBUG_USB, expr, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_DEBUG_IO(expr ...) \
|
||||
do { \
|
||||
if (LOG_LEVEL_IS(LOG_LVL_DEBUG_IO)) \
|
||||
|
||||
Reference in New Issue
Block a user