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