Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_debug.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2005 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KIS_DEBUG_H_
7#define KIS_DEBUG_H_
8
9#include <QDebug>
10#include <QLoggingCategory>
11
12#include "kritaglobal_export.h"
13
21extern const KRITAGLOBAL_EXPORT QLoggingCategory &_30009();
22extern const KRITAGLOBAL_EXPORT QLoggingCategory &_30010();
23extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41000();
24extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41001();
25extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41002();
26extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41003();
27extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41004();
28extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41005();
29extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41006();
30extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41007();
31extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41008();
32extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41009();
33extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41010();
34extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41011();
35extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41012();
36extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41013();
37extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41014();
38extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41015();
39extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41016();
40extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41017();
41extern const KRITAGLOBAL_EXPORT QLoggingCategory &_41018();
42
43#define dbgResources qCDebug(_30009)
44#define dbgDbMigration qCDebug(_30010)
45#define dbgKrita qCDebug(_41000)
46#define dbgImage qCDebug(_41001)
47#define dbgRegistry qCDebug(_41002)
48#define dbgTools qCDebug(_41003)
49#define dbgTiles qCDebug(_41004)
50#define dbgFilters qCDebug(_41005)
51#define dbgPlugins qCDebug(_41006)
52#define dbgUI qCDebug(_41007)
53#define dbgFile qCDebug(_41008)
54#define dbgMath qCDebug(_41009)
55#define dbgRender qCDebug(_41010)
56#define dbgScript qCDebug(_41011)
57#define dbgInput qCDebug(_41012)
58#define dbgAction qCDebug(_41013)
59#define dbgTablet qCDebug(_41014)
60#define dbgOpenGL qCDebug(_41015)
61#define dbgMetaData qCDebug(_41016)
62#define dbgAndroid qCDebug(_41017)
63#define dbgLocale qCDebug(_41018)
64
65#define infoResources qCInfo(_30009)
66#define infoDbMigration qCInfo(_30010)
67#define infoKrita qCInfo(_41000)
68#define infoImage qCInfo(_41001)
69#define infoRegistry qCInfo(_41002)
70#define infoTools qCInfo(_41003)
71#define infoTiles qCInfo(_41004)
72#define infoFilters qCInfo(_41005)
73#define infoPlugins qCInfo(_41006)
74#define infoUI qCInfo(_41007)
75#define infoFile qCInfo(_41008)
76#define infoMath qCInfo(_41009)
77#define infoRender qCInfo(_41010)
78#define infoScript qCInfo(_41011)
79#define infoInput qCInfo(_41012)
80#define infoAction qCDebug(_41013)
81#define infoTablet qCDebug(_41014)
82#define infoOpenGL qCDebug(_41015)
83#define infoMetaData qCDebug(_41016)
84
85#define warnResources qCWarning(_30009)
86#define warnDbMigration qCWarning(_30010)
87#define warnKrita qCWarning(_41000)
88#define warnImage qCWarning(_41001)
89#define warnRegistry qCWarning(_41002)
90#define warnTools qCWarning(_41003)
91#define warnTiles qCWarning(_41004)
92#define warnFilters qCWarning(_41005)
93#define warnPlugins qCWarning(_41006)
94#define warnUI qCWarning(_41007)
95#define warnFile qCWarning(_41008)
96#define warnMath qCWarning(_41009)
97#define warnRender qCWarning(_41010)
98#define warnScript qCWarning(_41011)
99#define warnInput qCWarning(_41012)
100#define warnAction qCDebug(_41013)
101#define warnTablet qCDebug(_41014)
102#define warnOpenGL qCDebug(_41015)
103#define warnMetaData qCDebug(_41016)
104
105#define errResources qCCritical(_30009)
106#define errDbMigration qCCritical(_30010)
107#define errKrita qCCritical(_41000)
108#define errImage qCCritical(_41001)
109#define errRegistry qCCritical(_41002)
110#define errTools qCCritical(_41003)
111#define errTiles qCCritical(_41004)
112#define errFilters qCCritical(_41005)
113#define errPlugins qCCritical(_41006)
114#define errUI qCCritical(_41007)
115#define errFile qCCritical(_41008)
116#define errMath qCCritical(_41009)
117#define errRender qCCritical(_41010)
118#define errScript qCCritical(_41011)
119#define errInput qCCritical(_41012)
120#define errAction qCDebug(_41013)
121#define errTablet qCDebug(_41014)
122#define errOpenGL qCDebug(_41015)
123#define errMetaData qCDebug(_41016)
124
125// Qt does not yet define qCFatal (TODO: this is an oversight, submit a patch upstream)
126/*
127#define fatalResources qCFatal(_30009)
128#define fatalKrita qCFatal(_41000)
129#define fatalImage qCFatal(_41001)
130#define fatalRegistry qCFatal(_41002)
131#define fatalTools qCFatal(_41003)
132#define fatalTiles qCFatal(_41004)
133#define fatalFilters qCFatal(_41005)
134#define fatalPlugins qCFatal(_41006)
135#define fatalUI qCFatal(_41007)
136#define fatalFile qCFatal(_41008)
137#define fatalMath qCFatal(_41009)
138#define fatalRender qCFatal(_41010)
139#define fatalScript qCFatal(_41011)
140#define fatalInput qCFatal(_41012)
141#define fatalAction qCDebug(_41013)
142*/
143
144
148KRITAGLOBAL_EXPORT QString kisBacktrace();
149
155#define ppVar( var ) #var << "=" << (var)
156
157
158#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
159# ifndef QT_NO_DEBUG
160# undef Q_ASSERT
161# define Q_ASSERT(cond) if(!(cond)) { errKrita.noquote() << kisBacktrace(); qt_assert(#cond,__FILE__,__LINE__); } qt_noop()
162# endif
163#endif
164
165#ifdef __GNUC__
166KRITAGLOBAL_EXPORT QString __methodName(const char *prettyFunction);
167#define __METHOD_NAME__ __methodName(__PRETTY_FUNCTION__)
168#else
169#define __METHOD_NAME__ "<unknown>:<unknown>"
170#endif
171
172#define PREPEND_METHOD(msg) QString("%1: %2").arg(__METHOD_NAME__).arg(msg)
173
174#ifdef __GNUC__
175#define ENTER_FUNCTION() qDebug() << "Entering" << __METHOD_NAME__
176#define LEAVE_FUNCTION() qDebug() << "Leaving " << __METHOD_NAME__
177#else
178#define ENTER_FUNCTION() qDebug() << "Entering" << "<unknown>"
179#define LEAVE_FUNCTION() qDebug() << "Leaving " << "<unknown>"
180#endif
181
182#include "kis_assert.h"
183
184#endif
QString __methodName(const char *_prettyFunction)
Definition kis_debug.cpp:95
const KRITAGLOBAL_EXPORT QLoggingCategory & _41003()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41006()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41011()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41017()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41009()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41005()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41015()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41012()
const KRITAGLOBAL_EXPORT QLoggingCategory & _30010()
const KRITAGLOBAL_EXPORT QLoggingCategory & _30009()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41004()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41007()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41001()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41016()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41000()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41014()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41002()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41008()
KRITAGLOBAL_EXPORT QString kisBacktrace()
Definition kis_debug.cpp:51
const KRITAGLOBAL_EXPORT QLoggingCategory & _41018()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41013()
const KRITAGLOBAL_EXPORT QLoggingCategory & _41010()