38 if ( mLogLevel > level )
42 if ( mLogFile.isOpen() )
45 mTextStream << formattedMessage;
48 else if ( mLogStderr )
63 mLogFile.setFileName( filename );
65 if ( ( ! filename.isEmpty() ) && mLogFile.open( QIODevice::Append ) )
67 mTextStream.setDevice( &mLogFile );
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Default implementation of message logging interface.
QString formatLogMessage(const QString &message, const QString &tag, Qgis::MessageLevel level=Qgis::MessageLevel::Info) const
Formats a log message.
virtual void logMessage(const QString &message, const QString &tag, Qgis::MessageLevel level)
Logs a message to stderr.
Writes message log into server logfile.
static QgsServerLogger * instance()
Gets the singleton instance.
void setLogLevel(Qgis::MessageLevel level)
Set the current log level.
void setLogFile(const QString &filename=QString())
Set the current log file.
void setLogStderr()
Activates logging to stderr.
void logMessage(const QString &message, const QString &tag, Qgis::MessageLevel level) override
Log a message from the server context.