QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RDebug Class Reference

This class provides some static methods for printing debugging information to stderr. More...

#include <RDebug.h>

List of all members.

Static Public Member Functions

static void printBacktrace (const QString &prefix=RDEFAULT_QString)
static void startTimer (int id=0)
 Starts a timer with the given ID.
static int stopTimer (int id, const QString &msg)
 Stops the timer with the given ID and prints the given message together with the time that has elapsed.
static int stopTimer (const QString &msg)
 Stops the timer with ID 0 and prints the given message together with the time that has elapsed.

Static Private Attributes

static QMap< int, QTime > timer

Detailed Description

This class provides some static methods for printing debugging information to stderr.

The methods accept a format string and parameters in the same way as the printf functions from standard C.

Messages can be logged with different priorities.

While there is no restriction as to what is logged, it is a good idea to log the class name and function name first.

// output for development:
qDebug("RMyClass::myFunction: i = %d", i);
// warnings ("this should not happen under normal cicumstances"):
qWarning("RMyClass::myFunction: cannot open file '%s'", fileName);
// indication for a bug in the application:
qWarning("RMyClass::myFunction: parent is NULL. Aborting.");
Scriptable:
This class is wrapped for script environments.

Member Function Documentation

void RDebug::printBacktrace ( const QString &  prefix = RDEFAULT_QString)
static
void RDebug::startTimer ( int  id = 0)
static

Starts a timer with the given ID.

int RDebug::stopTimer ( int  id,
const QString &  msg 
)
static

Stops the timer with the given ID and prints the given message together with the time that has elapsed.

static int RDebug::stopTimer ( const QString &  msg)
inlinestatic

Stops the timer with ID 0 and prints the given message together with the time that has elapsed.


Member Data Documentation

QMap< int, QTime > RDebug::timer
staticprivate

The documentation for this class was generated from the following files: