diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-10-03 12:57:42 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-05 12:42:40 -0700 |
commit | 1065a526358809019f7ec93eb3b8169f98baebf1 (patch) | |
tree | 55f28fdc1dab7b48fe14d89b085401444f636fa4 /core | |
parent | 468eb7ef33443dcc303aaf87e4d33302053238fa (diff) | |
download | subsurface-1065a526358809019f7ec93eb3b8169f98baebf1.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/libdivecomputer.c | 8 |
1 files changed, 6 insertions, 2 deletions
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)); |