00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LIBSIGNON_DEBUG_H
00024 #define LIBSIGNON_DEBUG_H
00025
00026 #include <QDebug>
00027
00028 #ifdef TRACE
00029 #undef TRACE
00030 #endif
00031
00032 #ifdef BLAME
00033 #undef BLAME
00034 #endif
00035
00036 #ifdef DEBUG_ENABLED
00037 extern int libsignon_logging_level;
00038 static inline bool debugEnabled() {
00039 return libsignon_logging_level >= 2;
00040 }
00041
00042 static inline bool criticalsEnabled() {
00043 return libsignon_logging_level >= 1;
00044 }
00045 #define TRACE() \
00046 if (debugEnabled()) qDebug()
00047 #define BLAME() \
00048 if (criticalsEnabled()) qCritical()
00049
00050 #else // DEBUG_ENABLED
00051 #define TRACE() while (0) qDebug()
00052 #define BLAME() while (0) qDebug()
00053 #endif
00054
00055 namespace SignOn {
00056
00057 void setLoggingLevel(int level);
00058 void initDebug();
00059
00060 }
00061
00062 #endif // LIBSIGNON_DEBUG_H