KDebug
Search for usage in LXR
#include <kdebug.h>
|
| KDebug (QtMsgType type, const char *f=nullptr, int l=-1, const char *info=nullptr) |
|
QDebug | operator() (bool cond, int area=KDE_DEFAULT_DEBUG_AREA) |
|
QDebug | operator() (int area=KDE_DEFAULT_DEBUG_AREA) |
|
A class for using operator()
Definition at line 300 of file kdebug.h.
◆ hasNullOutput()
bool KDebug::hasNullOutput |
( |
QtMsgType |
type, |
|
|
bool |
condition, |
|
|
int |
area, |
|
|
bool |
enableByDefault |
|
) |
| |
|
static |
◆ hasNullOutputQtDebugMsg() [1/2]
static bool KDebug::hasNullOutputQtDebugMsg |
( |
bool |
condition, |
|
|
int |
area = KDE_DEFAULT_DEBUG_AREA |
|
) |
| |
|
inlinestatic |
◆ hasNullOutputQtDebugMsg() [2/2]
static bool KDebug::hasNullOutputQtDebugMsg |
( |
int |
area = KDE_DEFAULT_DEBUG_AREA | ) |
|
|
inlinestatic |
◆ registerArea()
int KDebug::registerArea |
( |
const QByteArray & |
areaName, |
|
|
bool |
enabled = true |
|
) |
| |
|
static |
- Since
- 4.4 Register a debug area dynamically.
- Parameters
-
areaName | the name of the area |
enabled | whether debug output should be enabled by default (users can override this in kdebugdialog5 or with DisableAll=true in kdebugrc) |
- Returns
- the area code that was allocated for this area
Typical usage: If all uses of the debug area are restricted to a single class, add a method like this (e.g. into the Private class, if there's one) static int debugArea() { static int s_area = KDebug::registerArea("areaName"); return s_area; }
Please do not use a file-static int, it would (indirectly) create KGlobal too early, create KConfig instances too early (breaking unittests which change QStandardPaths dirs), etc. By using a function as shown above, you make it all happen on-demand, rather than upfront.
If all uses of the debug area are restricted to a single .cpp file, do the same but outside any class, and then use a more specific name for the function.
If however multiple classes and files need the debug area, then declare it in one file without static, and use "extern int debugArea();" in other files (with a better name for the function of course).
Definition at line 891 of file kdebug.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:59:44 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.