QGIS API Documentation  3.0.2-Girona (307d082)
qgsmessagelog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmessagelog.h - interface for logging messages
3  ----------------------
4  begin : October 2011
5  copyright : (C) 2011 by Juergen E. Fischer
6  email : jef at norbit dot de
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSMESSAGELOG_H
17 #define QGSMESSAGELOG_H
18 
19 #include <QString>
20 #include <QObject>
21 
22 #include "qgis_core.h"
23 #include "qgis.h"
24 
38 class CORE_EXPORT QgsMessageLog : public QObject
39 {
40  Q_OBJECT
41 
42  public:
43 
47  QgsMessageLog() = default;
48 
50  static void logMessage( const QString &message, const QString &tag = QString(), Qgis::MessageLevel level = Qgis::Warning );
51 
52  signals:
53  void messageReceived( const QString &message, const QString &tag, Qgis::MessageLevel level );
54 
55  void messageReceived( bool received );
56 
57  private:
58 
59  void emitMessage( const QString &message, const QString &tag, Qgis::MessageLevel level );
60 
61 };
62 
70 class CORE_EXPORT QgsMessageLogConsole : public QObject
71 {
72  Q_OBJECT
73 
74  public:
76 
77  public slots:
78  void logMessage( const QString &message, const QString &tag, Qgis::MessageLevel level );
79 };
80 
81 #endif
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:78
Default implementation of message logging interface.
Definition: qgsmessagelog.h:70
Interface for logging messages from QGIS in GUI independent way.
Definition: qgsmessagelog.h:38