Save Subsurface version to libdivecomputer logfile

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
Miika Turkia 2017-09-28 06:00:58 +03:00 committed by janmulder
parent 1bc5050eff
commit 2a29d4a4ba
2 changed files with 6 additions and 0 deletions

View file

@ -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)

View file

@ -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)");