Class: QgsMessageLog

class qgis.core.QgsMessageLog

Bases: PyQt5.QtCore.QObject

Interface for logging messages from QGIS in GUI independent way.

This class provides abstraction of a tabbed window for showing messages to the user. By default QgsMessageLogOutput will be used if not overridden with another message log creator function.

QGIS application uses QgsMessageLog class for logging messages in a dockable window for the user.

QgsMessageLog is not usually directly created, but rather accessed through QgsApplication.messageLog().

QgsMessageLog() Constructor for QgsMessageLog.

Methods

childEvent

connectNotify

customEvent

disconnectNotify

isSignalConnected

logMessage

Adds a message to the log instance (and creates it if necessary).

receivers

sender

senderSignalIndex

timerEvent

Signals

messageReceived

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
logMessage(message: str, tag: str = '', level: Qgis.MessageLevel = Qgis.MessageLevel.Warning, notifyUser: bool = True)

Adds a message to the log instance (and creates it if necessary).

If notifyUser is True, then the message should be brought to the user’s attention by various UI hints. If it is False, the message should appear in logs silently. Note that log viewer implementations may only respect notification hints for certain message levels.

Parameters:
  • message (str) –

  • tag (str = '') –

  • level (Qgis.MessageLevel = Qgis.MessageLevel.Warning) –

  • notifyUser (bool = True) –

messageReceived

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
timerEvent(self, QTimerEvent)