From 1065a526358809019f7ec93eb3b8169f98baebf1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 3 Oct 2020 12:57:42 -0700 Subject: libdc/debug: provide better info regarding libdc interaction Instead of just sending this to the user through the progress bar text, also send things to stderr in verbose mode. That should make it easier to debug situations where we fail to download from a dive computer. Signed-off-by: Dirk Hohndel --- core/libdivecomputer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/libdivecomputer.c') diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index b56daeb81..bca99d377 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -431,6 +431,9 @@ static void dev_info(device_data_t *devdata, const char *fmt, ...) vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); progress_bar_text = buffer; + if (verbose) + INFO(0, "dev_info: %s\n", buffer); + if (progress_callback) (*progress_callback)(buffer); } @@ -1292,9 +1295,10 @@ static dc_status_t usbhid_device_open(dc_iostream_t **iostream, dc_context_t *co break; dc_iterator_free (iterator); - if (!device) + if (!device) { + ERROR(context, "didn't find HID device\n"); return DC_STATUS_NODEVICE; - + } dev_info(data, "Opening USB HID device for %04x:%04x", dc_usbhid_device_get_vid(device), dc_usbhid_device_get_pid(device)); -- cgit v1.2.3-70-g09d2