blob: 03d872584ea702446bb9bf627e752a4efaad915e (
plain)
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
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#ifndef TRACER_H
#define TRACER_H
#include <QtCore/QtGlobal>
QT_BEGIN_NAMESPACE
class Tracer
{
public:
Tracer(const char *func) : m_func(func)
{
qDebug("Entering function %s.", m_func);
}
~Tracer()
{
qDebug("Leaving function %s.", m_func);
}
private:
const char * const m_func;
};
QT_END_NAMESPACE
// #define TRACING_REQUESTED
#ifdef TRACING_REQUESTED
#define TRACE_OBJ Tracer traceObj__(Q_FUNC_INFO);
#else
#define TRACE_OBJ
#endif
#endif // TRACER_H
|