00001 #ifndef TRACE_HPP
00002 #define TRACE_HPP
00003
00004
00005
00006
00007 #include <QTextStream>
00008 #include <QtDebug>
00009 #include <QTime>
00010
00011 #include "Utility_global.h"
00012
00013 class UTILITYSHARED_EXPORT DbgTime
00014 {
00015 public:
00016 static QTime Ticks;
00017 DbgTime() { Ticks.start();}
00018 static long ticks() { return Ticks.elapsed();}
00019 static void restart() { Ticks.restart();}
00020 };
00021
00022
00023
00024
00025
00026 #define GDS qDebug() << "[" << DbgTime::ticks() << "] " << __FILE__ << ":"<< __FUNCTION__ << " [" << __LINE__ << "] "
00027
00028 #ifdef DEBUGON
00029 #define DBG(s) GDS << s;
00030 #else
00031 #define DBG(s)
00032 #endif
00033
00034
00035 #define DBG_IN DBG("Enter")
00036 #define DBG_OUT DBG("Exit")
00037
00038 #define TRC DBG("Trace");
00039
00040 #endif
00041