QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
31 class CORE_EXPORT QgsMessageLog : public QObject
32 {
33  Q_OBJECT;
34 
35  public:
36  static QgsMessageLog *instance();
37 
39  {
40  INFO = 0,
41  WARNING = 1,
42  CRITICAL = 2
43  };
44 
46  static void logMessage( QString message, QString tag = QString::null, MessageLevel level = WARNING );
47 
48  signals:
49  void messageReceived( QString message, QString tag, QgsMessageLog::MessageLevel level );
50 
51  private:
52  QgsMessageLog();
53 
54  void emitMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
55 
56  static QgsMessageLog *sInstance;
57 };
58 
59 
66 class CORE_EXPORT QgsMessageLogConsole : public QObject
67 {
68  Q_OBJECT;
69 
70  public:
72 
73  public slots:
74  void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
75 };
76 
77 #endif