23QString QgsSaveLogToFileAlgorithm::name()
const
25 return QStringLiteral(
"savelog" );
33QString QgsSaveLogToFileAlgorithm::displayName()
const
35 return QObject::tr(
"Save log to file" );
38QStringList QgsSaveLogToFileAlgorithm::tags()
const
40 return QObject::tr(
"record,messages,logged" ).split(
',' );
43QString QgsSaveLogToFileAlgorithm::group()
const
45 return QObject::tr(
"Modeler tools" );
48QString QgsSaveLogToFileAlgorithm::groupId()
const
50 return QStringLiteral(
"modelertools" );
53QString QgsSaveLogToFileAlgorithm::shortHelpString()
const
55 return QObject::tr(
"This algorithm saves the model's execution log to a file.\n"
56 "Optionally, the log can be saved in a HTML formatted version." );
59QString QgsSaveLogToFileAlgorithm::shortDescription()
const
61 return QObject::tr(
"Saves the model's log contents to a file." );
64QgsSaveLogToFileAlgorithm *QgsSaveLogToFileAlgorithm::createInstance()
const
66 return new QgsSaveLogToFileAlgorithm();
69void QgsSaveLogToFileAlgorithm::initAlgorithm(
const QVariantMap & )
77 const QString file = parameterAsFile( parameters, QStringLiteral(
"OUTPUT" ), context );
78 const bool useHtml = parameterAsBool( parameters, QStringLiteral(
"USE_HTML" ), context );
79 if ( !file.isEmpty() )
81 QFile exportFile( file );
82 if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
86 QTextStream fout( &exportFile );
87#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
88 fout.setCodec(
"UTF-8" );
93 res.insert( QStringLiteral(
"OUTPUT" ), file );
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
@ HideFromToolbox
Algorithm should be hidden from the toolbox.
@ SkipGenericModelLogging
When running as part of a model, the generic algorithm setup and results logging should be skipped.
virtual Qgis::ProcessingAlgorithmFlags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
virtual QString textLog() const
Returns the plain text contents of the log, which contains all messages pushed to the feedback object...
virtual QString htmlLog() const
Returns the HTML formatted contents of the log, which contains all messages pushed to the feedback ob...
A boolean parameter for processing algorithms.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...