Go to the documentation of this file.00001 #ifndef _DBGLOG_H_1638486468879_
00002 #define _DBGLOG_H_1638486468879_
00003
00004 #include <QtDebug>
00005
00006
00007 #define STRNUMB_HELP(x) #x
00008 #define STRNUMB(x) STRNUMB_HELP(x)
00009
00010
00011
00012 #if __STDC_VERSION__ < 199901L
00013 # if __GNUC__ >= 2
00014 # if defined(__PRETTY_FUNCTION__)
00015 # define __func__ __PRETTY_FUNCTION__
00016 # else
00017 # define __func__ __FILE__ " / " STRNUMB(__LINE__) ": " << __FUNCTION__
00018 # endif
00019 # else
00020 # define __func__ "<unknown>"
00021 # endif
00022 #endif
00023
00024
00025 #if defined(__FUNCTION__)
00026 # define CURRENT_FUNCTION_NAME __FUNCTION__
00027 #elif defined(__func__)
00028 # define CURRENT_FUNCTION_NAME __func__
00029 #else
00030 # define CURRENT_FUNCTION_NAME "<unknown>"
00031 #endif
00032
00033
00034 #define DBGLOG_PURE(x) do { qDebug() << x; } while(false)
00035
00036
00037 #define DBGLOG_(id, x) DBGLOG_PURE("<"id">\t" << CURRENT_FUNCTION_NAME << "->" << x)
00038
00039
00040 #define DBGLOG(x) DBGLOG_("EDITOR", x)
00041
00042
00043 #define DBGPAR(PAR) #PAR << "=" << PAR << " "
00044
00045
00046 #define RELLOG_PURE(x) do { qWarning() << x; } while(false)
00047 #define RELLOG_(id, x) RELLOG_PURE("<"id">\t" << "->" << x)
00048 #define RELLOG(x) RELLOG_("EDITOR", x)
00049
00050
00051 #endif //_DBGLOG_H_1638486468879_