00001 #ifndef __MESSAGE__
00002 #define __MESSAGE__
00003
00004 #include <QTextStream>
00005 #include <QString>
00006
00007 namespace apig {
00008
00010 class Message {
00011 public:
00012 static void error(QString message, bool prefix = true);
00013 static void error(char* message, bool prefix = true);
00014 static void warning(QString message, bool prefix = true);
00015 static void warning(char* message, bool prefix = true);
00016 static void info(QString message, bool prefix = false);
00017 static void info(char* message, bool prefix = false);
00018 static void debug(QString message, bool prefix = true);
00019 static void debug(char* message, bool prefix = true);
00020
00021 static bool checkGLErrors(QString location = QString::null);
00022
00023 private:
00024 static QTextStream
00025 errorStream,
00026 warningStream,
00027 infoStream,
00028 debugStream;
00029 static const QString
00030 ERROR_PREFIX,
00031 WARNING_PREFIX,
00032 INFO_PREFIX,
00033 DEBUG_PREFIX;
00034 };
00035
00036 #define MSG_DEBUG_VAR(v) Message::debug(QString(#v " = %1").arg(v))
00037 #define MSG_CHECK_GL Message::checkGLErrors(QString("file %1 line %2").arg(__FILE__).arg(__LINE__))
00038
00039
00040 }
00041
00042 #endif
00043