19#include "moc_qgsserverlogger.cpp"
39 if ( mLogLevel > level )
43 if ( mLogFile.isOpen() )
46 mTextStream << formattedMessage;
49 else if ( mLogStderr )
64 mLogFile.setFileName( filename );
66 if ( ( !filename.isEmpty() ) && mLogFile.open( QIODevice::Append ) )
68 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.