openPilotLog
adebug.h
1 #ifndef ADEBUG_H
2 #define ADEBUG_H
3 
4 /*
5 #include <QDebug>
6 
7 #if defined(__GNUC__) || defined(__clang__)
8  #define FUNC_IDENT __PRETTY_FUNCTION__
9 #elif defined(_MSC_VER)
10  #define FUNC_IDENT __FUNCSIG__
11 #else
12  #define FUNC_IDENT __func__
13 #endif
14 
15 // CAUTION: qDebug() doesnt print for non-DEBUG builds
16 #define DEB qDebug() << FUNC_IDENT << "\n\t"
17 #define DEB_SRC DEB
18 #define DEB_RAW qDebug() << '\t'
19 
20 
21 // [G]: TODO study cross platform terminal coloring
22 // might be silly but coloring specific words does increase
23 // ease of reading debug output. We dont have to go overboard
24 // start with the header.
25 // DRAFT:
26 // info -> white
27 // warning -> yellow
28 // critical -> red
29 // there is also fatal which even kills the program and could be purple.
30 #define INFO qInfo() << "info:"
31 #define WARN qWarning() << "warning:"
32 #define CRIT qCritical() << "critical:"
33 //#define NOT_IMPLEMENTED qCritical() << FUNC_IDENT << "\n\t" << "~~ NOT IMPLEMENTED ~~";
34 #define NOT_IMPLEMENTED(msg) qCritical() << FUNC_IDENT << "\n\tNOT IMPLEMENTED:" << msg
35 */
55 #define REPR(cls, str) \
56 friend \
57 QDebug operator<<(QDebug qdb, const cls& object) \
58 { \
59  qdb << QString(#cls) + '(' + str + ')'; \
60  return qdb; \
61 }
62 
63 #endif