umbrello/umbrello
#include <debug_utils.h>
Public Member Functions | |
~Tracer () | |
void | disable (const QString &name) |
void | disableAll () |
void | enable (const QString &name) |
void | enableAll () |
bool | isEnabled (const QString &name) |
Static Public Member Functions | |
static Tracer * | instance () |
static void | registerClass (const QString &name, bool state=true) |
Protected Member Functions | |
virtual void | showEvent (QShowEvent *) |
void | update (const QString &name) |
Detailed Description
The singleton class for switching on or off debug messages.
This class provides a user controllable way to enable class related debug output.
Classes could be registered with the static method registerClass().
With show() a dialog will be shown, in which the user is able to enable/disable debug output for each registered class.
Class related debug output implementation
To register classes independent from related object instantiation time one of the macros
DEBUG_REGISTER(className) DEBUG_REGISTER_DISABLED(className)
should be placed in the implementation part of a class before the first class methods. The first macro enables debug output for the related class, while the latter macro disables it by default.
Debug output in class methods should use
QObject based classes
DEBUG(DBG_SRC) << ...
other classes
DEBUG("class name") << ...
Definition at line 61 of file debug_utils.h.
Constructor & Destructor Documentation
Tracer::~Tracer | ( | ) |
Destructor.
Definition at line 59 of file debug_utils.cpp.
Member Function Documentation
void Tracer::disable | ( | const QString & | name | ) |
Disable debug output for the given class.
- Parameters
-
name class name
Definition at line 88 of file debug_utils.cpp.
void Tracer::disableAll | ( | ) |
Definition at line 99 of file debug_utils.cpp.
void Tracer::enable | ( | const QString & | name | ) |
Enable debug output for the given class.
- Parameters
-
name class name
Definition at line 78 of file debug_utils.cpp.
void Tracer::enableAll | ( | ) |
Definition at line 94 of file debug_utils.cpp.
|
static |
Definition at line 30 of file debug_utils.cpp.
bool Tracer::isEnabled | ( | const QString & | name | ) |
Return debugging state for a given class.
- Parameters
-
name the class name to check
Definition at line 69 of file debug_utils.cpp.
|
static |
Register class for debug output.
- Parameters
-
name class name state initial enabled state
Definition at line 109 of file debug_utils.cpp.
|
protectedvirtual |
Fill tree widget with collected classes.
Definition at line 133 of file debug_utils.cpp.
|
protected |
Transfer class state into tree widget.
- Parameters
-
name class name
Definition at line 120 of file debug_utils.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.