-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathdebug.h
42 lines (30 loc) · 863 Bytes
/
debug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include <QDebug>
#ifdef QT_NO_DEBUG_OUTPUT
/* Qt is defined to squelch debug output. Simply forward to
* qDebug()'s definition.
*/
#define DEBUGOUT qDebug()
#define WARNINGOUT qWarning() << "WARNING"
#else
#include <QtGlobal>
#include <QFileInfo>
/* We're debugging.
* Add crazy mumbo jumbo here.
*/
/** Print filename / line / function info
*/
#if defined(_MSC_VER)
#define __func__ __FUNCTION__
#endif
#define DEBUGOUT qDebug() << \
QString::fromUtf8("%1:%2 [%3()]"). \
arg(QFileInfo( QString::fromUtf8(__FILE__) ).fileName()). \
arg(QString::number( __LINE__ )). \
arg(QString::fromUtf8(__func__) )
#define WARNINGOUT qWarning() << "WARNING" << \
QString::fromUtf8("%1:%2 [%3()]"). \
arg(QFileInfo( QString::fromUtf8(__FILE__) ).fileName()). \
arg(QString::number( __LINE__ )). \
arg(QString::fromUtf8(__func__) )
#endif