Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgsmessagelog.h - interface for logging messages 00003 ---------------------- 00004 begin : October 2011 00005 copyright : (C) 2011 by Juergen E. Fischer 00006 email : jef at norbit dot de 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef QGSMESSAGELOG_H 00017 #define QGSMESSAGELOG_H 00018 00019 #include <QString> 00020 #include <QObject> 00021 00033 class CORE_EXPORT QgsMessageLog : public QObject 00034 { 00035 Q_OBJECT; 00036 00037 public: 00038 static QgsMessageLog *instance(); 00039 00041 static void logMessage( QString message, QString tag = QString::null, int level = 0 ); 00042 00043 signals: 00044 void messageReceived( QString message, QString tag, int level ); 00045 00046 private: 00047 QgsMessageLog(); 00048 00049 void emitMessage( QString message, QString tag, int level ); 00050 00051 static QgsMessageLog *sInstance; 00052 }; 00053 00054 00061 class CORE_EXPORT QgsMessageLogConsole : public QObject 00062 { 00063 Q_OBJECT; 00064 00065 public: 00066 QgsMessageLogConsole(); 00067 00068 public slots: 00069 void logMessage( QString message, QString tag, int level ); 00070 }; 00071 00072 #endif