File: debug.h

package info (click to toggle)
dspdfviewer 1.15.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 752 kB
  • ctags: 273
  • sloc: cpp: 2,294; makefile: 12
file content (42 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (3)
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