Skip to content
Permalink
Browse files

[processing] Report provider version string alongside QGIS version in…

… log

Helpful for debugging and reproducability of results
  • Loading branch information
nyalldawson committed Apr 8, 2019
1 parent 708bf44 commit 933559b6555ce821b7a90bb0421677382774b8d7
@@ -9,6 +9,7 @@




class QgsProcessingFeedback : QgsFeedback
{
%Docstring
@@ -92,7 +93,7 @@ report the output from executing an external command or subprocess.
.. seealso:: :py:func:`pushCommandInfo`
%End

void pushVersionInfo();
void pushVersionInfo( const QgsProcessingProvider *provider = 0 );
%Docstring
Pushes a summary of the QGIS (and underlying library) version information to the log.

@@ -205,7 +205,7 @@ def runAlgorithm(self):
break

self.clearProgress()
self.feedback.pushVersionInfo()
self.feedback.pushVersionInfo(self.algorithm().provider())
self.setProgressText(QCoreApplication.translate('AlgorithmDialog', 'Processing algorithm…'))

self.setInfo(
@@ -17,6 +17,7 @@

#include "qgsprocessingfeedback.h"
#include "qgsgeos.h"
#include "qgsprocessingprovider.h"
#include <ogr_api.h>
#include <gdal_version.h>
#if PROJ_VERSION_MAJOR > 4
@@ -54,7 +55,7 @@ void QgsProcessingFeedback::pushConsoleInfo( const QString &info )
QgsMessageLog::logMessage( info, tr( "Processing" ), Qgis::Info );
}

void QgsProcessingFeedback::pushVersionInfo()
void QgsProcessingFeedback::pushVersionInfo( const QgsProcessingProvider *provider )
{
pushDebugInfo( tr( "QGIS version: %1" ).arg( Qgis::QGIS_VERSION ) );
if ( QString( Qgis::QGIS_DEV_VERSION ) != QLatin1String( "exported" ) )
@@ -71,6 +72,10 @@ void QgsProcessingFeedback::pushVersionInfo()
#else
pushDebugInfo( tr( "PROJ version: %1" ).arg( PJ_VERSION ) );
#endif
if ( provider && !provider->versionInfo().isEmpty() )
{
pushDebugInfo( tr( "%1 version: %2" ).arg( provider->name(), provider->versionInfo() ) );
}
}


@@ -22,6 +22,8 @@
#include "qgsfeedback.h"
#include "qgsmessagelog.h"

class QgsProcessingProvider;

/**
* \class QgsProcessingFeedback
* \ingroup core
@@ -95,7 +97,7 @@ class CORE_EXPORT QgsProcessingFeedback : public QgsFeedback
* Pushes a summary of the QGIS (and underlying library) version information to the log.
* \since QGIS 3.4.7
*/
void pushVersionInfo();
void pushVersionInfo( const QgsProcessingProvider *provider = nullptr );

};

0 comments on commit 933559b

Please sign in to comment.
You can’t perform that action at this time.