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 );
QString formatLogMessage(const QString &message, const QString &tag, Qgis::MessageLevel level=Qgis::Info) const
Formats a log message.
void logMessage(const QString &message, const QString &tag, Qgis::MessageLevel level) override
Log a message from the server context.
MessageLevel
Level for messages This will be used both for message log and message bar in application.
void setLogLevel(Qgis::MessageLevel level)
Set the current log level.
virtual void logMessage(const QString &message, const QString &tag, Qgis::MessageLevel level)
Logs a message to stderr.
Writes message log into server logfile.
Default implementation of message logging interface.
void setLogStderr()
Activates logging to stderr.
static QgsServerLogger * instance()
Gets the singleton instance.
void setLogFile(const QString &filename=QString())
Set the current log file.