24QString QgsSaveLogToFileAlgorithm::name()
const
26 return QStringLiteral(
"savelog" );
34QString QgsSaveLogToFileAlgorithm::displayName()
const
36 return QObject::tr(
"Save log to file" );
39QStringList QgsSaveLogToFileAlgorithm::tags()
const
41 return QObject::tr(
"record,messages,logged" ).split(
',' );
44QString QgsSaveLogToFileAlgorithm::group()
const
46 return QObject::tr(
"Modeler tools" );
49QString QgsSaveLogToFileAlgorithm::groupId()
const
51 return QStringLiteral(
"modelertools" );
54QString QgsSaveLogToFileAlgorithm::shortHelpString()
const
56 return QObject::tr(
"This algorithm saves the model's execution log to a file.\n"
57 "Optionally, the log can be saved in a HTML formatted version." );
60QString QgsSaveLogToFileAlgorithm::shortDescription()
const
62 return QObject::tr(
"Saves the model's log contents to a file." );
65QgsSaveLogToFileAlgorithm *QgsSaveLogToFileAlgorithm::createInstance()
const
67 return new QgsSaveLogToFileAlgorithm();
70void QgsSaveLogToFileAlgorithm::initAlgorithm(
const QVariantMap & )
78 const QString file = parameterAsFile( parameters, QStringLiteral(
"OUTPUT" ), context );
79 const bool useHtml = parameterAsBool( parameters, QStringLiteral(
"USE_HTML" ), context );
80 if ( !file.isEmpty() )
82 QFile exportFile( file );
83 if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
87 QTextStream fout( &exportFile );
88#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
89 fout.setCodec(
"UTF-8" );
94 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...