QGIS API Documentation  2.99.0-Master (9fdd060)
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 
37 class CORE_EXPORT QgsMessageLog : public QObject
38 {
39  Q_OBJECT
40 
41  public:
42 
44  {
45  ALL = 0,
46  INFO = 0,
47  WARNING = 1,
48  CRITICAL = 2,
49  NONE = 3
50  };
51  Q_ENUM( MessageLevel );
52 
56  QgsMessageLog() = default;
57 
59  static void logMessage( const QString &message, const QString &tag = QString(), MessageLevel level = QgsMessageLog::WARNING );
60 
61  signals:
62  void messageReceived( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
63 
64  void messageReceived( bool received );
65 
66  private:
67 
68  void emitMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
69 
70 };
71 
79 class CORE_EXPORT QgsMessageLogConsole : public QObject
80 {
81  Q_OBJECT
82 
83  public:
85 
86  public slots:
87  void logMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
88 };
89 
90 #endif
Default implementation of message logging interface.
Definition: qgsmessagelog.h:79
Interface for logging messages from QGIS in GUI independent way.
Definition: qgsmessagelog.h:37