Battle with include files (lost).
[dorian] / trace.h
1 #ifndef TRACE_H
2 #define TRACE_H
3
4 #include <QtGlobal>
5 #include <QtDebug>
6 #include <QString>
7 #include <QTime>
8 #include <QEvent>
9
10 #define TRACE Trace _(Q_FUNC_INFO)
11
12 /** Trace helper. */
13 class Trace
14 {
15 public:
16     Trace(const QString &s);
17     ~Trace();
18     static QString event(QEvent::Type t);
19     static void messageHandler(QtMsgType type, const char *msg);
20     static QtMsgType level;
21
22 protected:
23     static QString prefix();
24     QString name;
25     static int indent;
26     typedef struct {int type; const char *name;} EventName;
27     static EventName eventTab[];
28 };
29
30 #endif // TRACE_H