22 QString QgsSaveLogToFileAlgorithm::name()
const
24 return QStringLiteral(
"savelog" );
27 QgsProcessingAlgorithm::Flags QgsSaveLogToFileAlgorithm::flags()
const
32 QString QgsSaveLogToFileAlgorithm::displayName()
const
34 return QObject::tr(
"Save log to file" );
37 QStringList QgsSaveLogToFileAlgorithm::tags()
const
39 return QObject::tr(
"record,messages,logged" ).split(
',' );
42 QString QgsSaveLogToFileAlgorithm::group()
const
44 return QObject::tr(
"Modeler tools" );
47 QString QgsSaveLogToFileAlgorithm::groupId()
const
49 return QStringLiteral(
"modelertools" );
52 QString QgsSaveLogToFileAlgorithm::shortHelpString()
const
54 return QObject::tr(
"This algorithm saves the model's execution log to a file.\n"
55 "Optionally, the log can be saved in a HTML formatted version." );
58 QString QgsSaveLogToFileAlgorithm::shortDescription()
const
60 return QObject::tr(
"Saves the model's log contents to a file." );
63 QgsSaveLogToFileAlgorithm *QgsSaveLogToFileAlgorithm::createInstance()
const
65 return new QgsSaveLogToFileAlgorithm();
68 void QgsSaveLogToFileAlgorithm::initAlgorithm(
const QVariantMap & )
76 const QString file = parameterAsFile( parameters, QStringLiteral(
"OUTPUT" ), context );
77 const bool useHtml = parameterAsBool( parameters, QStringLiteral(
"USE_HTML" ), context );
78 if ( !file.isEmpty() )
80 QFile exportFile( file );
81 if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Truncate ) )
85 QTextStream fout( &exportFile );
89 res.insert( QStringLiteral(
"OUTPUT" ), file );