From ee8b37cc6e4308ea1327a7d133d7ca47f1bb26a5 Mon Sep 17 00:00:00 2001 From: Michael Keller Date: Fri, 19 Apr 2024 15:31:34 +1200 Subject: [PATCH] Import: Fix Info Logging. Avoid logging the expected outcome (success) at info level. Signed-off-by: Michael Keller --- core/libdivecomputer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/libdivecomputer.cpp b/core/libdivecomputer.cpp index 22c3de3bc..77d7b11c5 100644 --- a/core/libdivecomputer.cpp +++ b/core/libdivecomputer.cpp @@ -1503,14 +1503,15 @@ const char *do_libdivecomputer_import(device_data_t *data) } else { dev_info(data, "Connecting ..."); rc = dc_device_open(&data->device, data->context, data->descriptor, data->iostream); - INFO(0, "dc_device_open error value of %d", rc); - if (rc != DC_STATUS_SUCCESS && subsurface_access(data->devname, R_OK | W_OK) != 0) + if (rc != DC_STATUS_SUCCESS) { + INFO(0, "dc_device_open error value of %d", rc); + if (subsurface_access(data->devname, R_OK | W_OK) != 0) #if defined(SUBSURFACE_MOBILE) - err = translate("gettextFromC", "Error opening the device %s %s (%s).\nIn most cases, in order to debug this issue, it is useful to send the developers the log files. You can copy them to the clipboard in the About dialog."); + err = translate("gettextFromC", "Error opening the device %s %s (%s).\nIn most cases, in order to debug this issue, it is useful to send the developers the log files. You can copy them to the clipboard in the About dialog."); #else - err = translate("gettextFromC", "Error opening the device %s %s (%s).\nIn most cases, in order to debug this issue, a libdivecomputer logfile will be useful.\nYou can create this logfile by selecting the corresponding checkbox in the download dialog."); + err = translate("gettextFromC", "Error opening the device %s %s (%s).\nIn most cases, in order to debug this issue, a libdivecomputer logfile will be useful.\nYou can create this logfile by selecting the corresponding checkbox in the download dialog."); #endif - if (rc == DC_STATUS_SUCCESS) { + } else { dev_info(data, "Starting import ..."); err = do_device_import(data); /* TODO: Show the logfile to the user on error. */