aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2017-09-28 06:00:58 +0300
committerGravatar janmulder <jlmulder@xs4all.nl>2017-09-28 08:51:34 +0200
commit2a29d4a4ba0689b37e139a8096aaa5d2382010a7 (patch)
treea15b0c8554ea3940fc0cf07f08a3412f7c6b265e
parent1bc5050effccfe542b81a19f50e5d478e44ae3fa (diff)
downloadsubsurface-2a29d4a4ba0689b37e139a8096aaa5d2382010a7.tar.gz
Save Subsurface version to libdivecomputer logfile
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
-rw-r--r--core/configuredivecomputer.cpp3
-rw-r--r--core/libdivecomputer.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/core/configuredivecomputer.cpp b/core/configuredivecomputer.cpp
index 1e34e2546..b59f1916b 100644
--- a/core/configuredivecomputer.cpp
+++ b/core/configuredivecomputer.cpp
@@ -8,6 +8,7 @@
#include <libxslt/transform.h>
#include <QStringList>
#include <QXmlStreamWriter>
+#include "core/version.h"
ConfigureDiveComputer::ConfigureDiveComputer() : readThread(0),
writeThread(0),
@@ -630,6 +631,8 @@ QString ConfigureDiveComputer::dc_open(device_data_t *data)
if (fp) {
dc_context_set_loglevel(data->context, DC_LOGLEVEL_ALL);
dc_context_set_logfunc(data->context, logfunc, fp);
+ fprintf(data->libdc_logfile, "Subsurface: v%s, ", subsurface_git_version());
+ fprintf(data->libdc_logfile, "built with libdivecomputer v%s\n", dc_version(NULL));
}
#if defined(SSRF_CUSTOM_IO)
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index beae7c521..d8fe54e8d 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -16,6 +16,7 @@
#include <libdivecomputer/version.h>
#include "libdivecomputer.h"
+#include "core/version.h"
#if !defined(SSRF_LIBDC_VERSION) || SSRF_LIBDC_VERSION < 2
#pragma message "Subsurface requires a reasonably current version of the Subsurface-branch"
@@ -1086,6 +1087,8 @@ const char *do_libdivecomputer_import(device_data_t *data)
if (fp) {
dc_context_set_loglevel(data->context, DC_LOGLEVEL_ALL);
dc_context_set_logfunc(data->context, logfunc, fp);
+ fprintf(data->libdc_logfile, "Subsurface: v%s, ", subsurface_git_version());
+ fprintf(data->libdc_logfile, "built with libdivecomputer v%s\n", dc_version(NULL));
}
err = translate("gettextFromC", "Unable to open %s %s (%s)");