QGIS API Documentation  2.0.1-Dufour
 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 
33 class CORE_EXPORT QgsMessageLog : public QObject
34 {
35  Q_OBJECT;
36 
37  public:
38  static QgsMessageLog *instance();
39 
41  {
42  INFO = 0,
43  WARNING = 1,
44  CRITICAL = 2
45  };
46 
48  static void logMessage( QString message, QString tag = QString::null, MessageLevel level = WARNING );
49 
50  signals:
51  void messageReceived( QString message, QString tag, QgsMessageLog::MessageLevel level );
52 
53  private:
54  QgsMessageLog();
55 
56  void emitMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
57 
59 };
60 
61 
68 class CORE_EXPORT QgsMessageLogConsole : public QObject
69 {
70  Q_OBJECT;
71 
72  public:
74 
75  public slots:
76  void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
77 };
78 
79 #endif