2017-04-07 08:50:57 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmessagelog.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-13 10:28:05 +02:00
|
|
|
class QgsMessageLog : QObject
|
2011-11-18 23:05:48 +01:00
|
|
|
{
|
2017-04-07 08:50:57 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2017-04-20 13:48:50 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
QGIS application uses QgsMessageLog class for logging messages in a dockable
|
|
|
|
window for the user.
|
2017-04-07 08:50:57 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
QgsMessageLog is not usually directly created, but rather accessed through
|
2017-12-19 11:43:52 -04:00
|
|
|
:py:func:`QgsApplication.messageLog()`
|
2011-11-18 23:05:48 +01:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-04-07 08:50:57 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmessagelog.h"
|
|
|
|
%End
|
2011-11-18 23:05:48 +01:00
|
|
|
public:
|
2012-01-18 19:21:42 +01:00
|
|
|
|
2017-04-07 08:50:57 +02:00
|
|
|
QgsMessageLog();
|
2017-09-28 08:17:06 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsMessageLog.
|
2017-09-28 08:17:06 +10:00
|
|
|
%End
|
2012-01-18 19:21:42 +01:00
|
|
|
|
2018-06-18 10:34:15 +10:00
|
|
|
static void logMessage( const QString &message, const QString &tag = QString(), Qgis::MessageLevel level = Qgis::Warning, bool notifyUser = true );
|
2017-04-07 08:50:57 +02:00
|
|
|
%Docstring
|
2018-06-18 10:34:15 +10:00
|
|
|
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.
|
2017-04-07 08:50:57 +02:00
|
|
|
%End
|
2012-01-18 19:21:42 +01:00
|
|
|
|
2017-04-07 08:50:57 +02:00
|
|
|
signals:
|
2018-06-18 10:34:15 +10:00
|
|
|
|
2018-02-05 22:11:34 -04:00
|
|
|
void messageReceived( const QString &message, const QString &tag, Qgis::MessageLevel level );
|
2018-06-18 10:34:15 +10:00
|
|
|
%Docstring
|
|
|
|
Emitted whenever the log receives a ``message``.
|
|
|
|
|
|
|
|
This signal is emitted for all messages received by the log, regardless of the ``notifyUser`` flag's
|
|
|
|
value for the message.
|
|
|
|
%End
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2017-04-07 08:50:57 +02:00
|
|
|
void messageReceived( bool received );
|
2018-06-18 10:34:15 +10:00
|
|
|
%Docstring
|
2018-06-18 11:53:02 +10:00
|
|
|
Emitted whenever the log receives a message which is not a Qgis.Info level message
|
|
|
|
and which has the ``notifyUser`` flag as true.
|
2018-06-18 10:34:15 +10:00
|
|
|
|
|
|
|
If QgsMessageLogNotifyBlocker objects have been created then this signal may be
|
|
|
|
temporarily suppressed.
|
|
|
|
|
|
|
|
.. seealso:: :py:class:`QgsMessageLogNotifyBlocker`
|
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsMessageLogNotifyBlocker
|
|
|
|
{
|
|
|
|
%Docstring
|
|
|
|
Temporarily blocks the application QgsMessageLog (see QgsApplication.messageLog()) from emitting the messageReceived( bool )
|
|
|
|
signal for the lifetime of the object.
|
|
|
|
|
|
|
|
Using this blocker allows messages to be logged without causing user interface hints flagging message log
|
|
|
|
errors to be created.
|
|
|
|
|
|
|
|
QgsMessageLogNotifyBlocker supports "stacked" blocking, so two QgsMessageLogNotifyBlocker created
|
|
|
|
will both need to be destroyed before the messageReceived( bool ) signal is emitted again.
|
|
|
|
|
|
|
|
.. versionadded:: 3.2
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmessagelog.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
QgsMessageLogNotifyBlocker();
|
|
|
|
%Docstring
|
|
|
|
Constructor for QgsMessageLogNotifyBlocker.
|
|
|
|
|
|
|
|
This will block the log from emitting the messageReceived( bool ) signal for the lifetime of this object.
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
~QgsMessageLogNotifyBlocker();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2018-06-18 10:34:15 +10:00
|
|
|
private:
|
|
|
|
QgsMessageLogNotifyBlocker( const QgsMessageLogNotifyBlocker &other );
|
2017-04-07 08:50:57 +02:00
|
|
|
};
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
class QgsMessageLogConsole : QObject
|
|
|
|
{
|
2017-04-07 08:50:57 +02:00
|
|
|
%Docstring
|
2018-05-26 14:10:30 +10:00
|
|
|
Default implementation of message logging interface
|
2017-04-20 13:48:50 +02:00
|
|
|
|
2017-04-07 08:50:57 +02:00
|
|
|
This class outputs log messages to the standard output. Therefore it might
|
|
|
|
be the right choice for apps without GUI.
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
|
2017-04-07 08:50:57 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsmessagelog.h"
|
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
public:
|
|
|
|
QgsMessageLogConsole();
|
|
|
|
|
|
|
|
public slots:
|
2018-02-05 22:11:34 -04:00
|
|
|
void logMessage( const QString &message, const QString &tag, Qgis::MessageLevel level );
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
2017-04-07 08:50:57 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/qgsmessagelog.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|