Class: QgsMessageLog¶
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().
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Static Methods
Adds a message to the log instance (and creates it if necessary). |
Signals
Emitted whenever the log receives a message which is not a |
|
Emitted whenever the log receives a message. |
- class qgis.core.QgsMessageLog[source]¶
Bases:
QObject- static logMessage(message: str | None, tag: str | None = '', level: Qgis.MessageLevel = Qgis.MessageLevel.Warning, notifyUser: bool = True, file: str | None = __builtin_FILE(), function: str | None = __builtin_FUNCTION(), line: int = __builtin_LINE(), format: Qgis.StringFormat = Qgis.StringFormat.PlainText)[source]¶
Adds a
messageto the log instance (and creates it if necessary).If
notifyUserisTrue, then the message should be brought to the user’s attention by various UI hints. If it isFalse, the message should appear in logs silently. Note that log viewer implementations may only respect notification hints for certain message levels.The
formatparameter specifies the message format (since QGIS 4.0).- Parameters:
message (Optional[str])
tag (Optional[str] = '')
level (Qgis.MessageLevel = Qgis.MessageLevel.Warning)
notifyUser (bool = True)
file (Optional[str] = __builtin_FILE())
function (Optional[str] = __builtin_FUNCTION())
line (int = __builtin_LINE())
format (Qgis.StringFormat = Qgis.StringFormat.PlainText)
- signal messageReceived(received: bool)[source]¶
Emitted whenever the log receives a message which is not a
Qgis.MessageLevel.Info level message and which has thenotifyUserflag asTrue.If
QgsMessageLogNotifyBlockerobjects have been created then this signal may be temporarily suppressed.See also
- Parameters:
received (bool)
- signal messageReceivedWithFormat(message: str, tag: str, level: Qgis.MessageLevel, : Qgis.StringFormat)[source]¶
Emitted whenever the log receives a
message.This signal is emitted for all messages received by the log, regardless of the
notifyUserflag’s value for the message.- Parameters:
message (str)
tag (str)
level (Qgis.MessageLevel)
:param : :type : Qgis.StringFormat