23using namespace Qt::StringLiterals;
27QString QgsSaveLogToFileAlgorithm::name()
const
37QString QgsSaveLogToFileAlgorithm::displayName()
const
39 return QObject::tr(
"Save log to file" );
42QStringList QgsSaveLogToFileAlgorithm::tags()
const
44 return QObject::tr(
"record,messages,logged" ).split(
',' );
47QString QgsSaveLogToFileAlgorithm::group()
const
49 return QObject::tr(
"Modeler tools" );
52QString QgsSaveLogToFileAlgorithm::groupId()
const
54 return u
"modelertools"_s;
57QString QgsSaveLogToFileAlgorithm::shortHelpString()
const
59 return QObject::tr(
"This algorithm saves the model's execution log to a file.\n"
60 "Optionally, the log can be saved in a HTML formatted version." );
63QString QgsSaveLogToFileAlgorithm::shortDescription()
const
65 return QObject::tr(
"Saves the model's log contents to a file." );
68QgsSaveLogToFileAlgorithm *QgsSaveLogToFileAlgorithm::createInstance()
const
70 return new QgsSaveLogToFileAlgorithm();
73void QgsSaveLogToFileAlgorithm::initAlgorithm(
const QVariantMap & )
81 const QString file = parameterAsFile( parameters, u
"OUTPUT"_s, context );
82 const bool useHtml = parameterAsBool( parameters, u
"USE_HTML"_s, context );
83 if ( !file.isEmpty() )
85 QFile exportFile( file );
86 if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
90 QTextStream fout( &exportFile );
94 res.insert( u
"OUTPUT"_s, 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...